mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
portalapi: don't leak the full list of users nor private apps
This commit is contained in:
parent
16d7f77f91
commit
045869283c
1 changed files with 14 additions and 1 deletions
|
@ -115,7 +115,16 @@ def portal_public():
|
|||
"""Get public settings
|
||||
If the portal is set as public, it will include the list of public apps
|
||||
"""
|
||||
return _get_portal_settings()
|
||||
|
||||
portal_settings = _get_portal_settings()
|
||||
|
||||
del portal_settings["portal_user_intro"]
|
||||
|
||||
# Prevent leaking the list of users
|
||||
for infos in portal_settings["apps"].values():
|
||||
del infos["users"]
|
||||
|
||||
return portal_settings
|
||||
|
||||
|
||||
def portal_me():
|
||||
|
@ -131,6 +140,10 @@ def portal_me():
|
|||
# Get user allowed apps
|
||||
apps = _get_portal_settings(domain, username)["apps"]
|
||||
|
||||
# Prevent leaking the list of users
|
||||
for infos in apps.values():
|
||||
del infos["users"]
|
||||
|
||||
result_dict = {
|
||||
"username": username,
|
||||
"fullname": user["cn"][0],
|
||||
|
|
Loading…
Add table
Reference in a new issue