From 7989271e749257639a35f3b055de4dbb8bfdf1ee Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 14 Apr 2021 20:16:58 +0200 Subject: [PATCH] user_permission_list: also support filtering for apps not installed or system perms --- src/yunohost/permission.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/yunohost/permission.py b/src/yunohost/permission.py index 493f11953..9fe6c4e4f 100644 --- a/src/yunohost/permission.py +++ b/src/yunohost/permission.py @@ -74,13 +74,12 @@ def user_permission_list( ) # Parse / organize information to be outputed - if apps: - ignore_system_perms = True - apps = apps if apps else sorted(_installed_apps()) + installed_apps = sorted(_installed_apps()) + apps = apps if apps else installed_apps apps_base_path = { app: app_setting(app, "domain") + app_setting(app, "path") 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 = {} @@ -89,7 +88,10 @@ def user_permission_list( name = infos["cn"][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 perm = {}