user_permission_list: also support filtering for apps not installed or system perms

This commit is contained in:
Alexandre Aubin 2021-04-14 20:16:58 +02:00
parent 8b360ac2e6
commit 7989271e74

View file

@ -74,13 +74,12 @@ def user_permission_list(
) )
# Parse / organize information to be outputed # Parse / organize information to be outputed
if apps: installed_apps = sorted(_installed_apps())
ignore_system_perms = True apps = apps if apps else installed_apps
apps = apps if apps else sorted(_installed_apps())
apps_base_path = { apps_base_path = {
app: app_setting(app, "domain") + app_setting(app, "path") app: app_setting(app, "domain") + app_setting(app, "path")
for app in apps for app in apps
if app_setting(app, "domain") and app_setting(app, "path") if app in installed_apps and app_setting(app, "domain") and app_setting(app, "path")
} }
permissions = {} permissions = {}
@ -89,7 +88,10 @@ def user_permission_list(
name = infos["cn"][0] name = infos["cn"][0]
app = name.split(".")[0] app = name.split(".")[0]
if app in SYSTEM_PERMS and ignore_system_perms: if ignore_system_perms and app in SYSTEM_PERMS:
continue
if app not in apps:
continue continue
perm = {} perm = {}