mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 20:07:16 +08:00
Fix the judgment of app admin
This commit is contained in:
@@ -127,8 +127,9 @@ def is_app_admin(app=None):
|
|||||||
app = app or 'cmdb'
|
app = app or 'cmdb'
|
||||||
app_id = AppCache.get(app).id
|
app_id = AppCache.get(app).id
|
||||||
|
|
||||||
for role in session.get("acl", {}).get("parentRoles", []):
|
for role_name in session.get("acl", {}).get("parentRoles", []):
|
||||||
if RoleCache.get_by_name(app_id, role).is_app_admin:
|
role = RoleCache.get_by_name(app_id, role_name)
|
||||||
|
if role and role.is_app_admin:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user