fix: role user permission (#3453)

This commit is contained in:
shaohuzhang1 2025-07-02 14:58:02 +08:00 committed by GitHub
parent 25125ca571
commit 191e62f96d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -229,7 +229,7 @@ system_role = RoleConstants.ADMIN.value.name
def reset_workspace_role(role_id, workspace_id, role_dict):
if system_role_list.__contains__(role_id):
if system_role == role_id:
return role_id
return [role_id]
else:
return [f"{role_id}:/WORKSPACE/{workspace_id}", role_id]
else:
@ -238,7 +238,7 @@ def reset_workspace_role(role_id, workspace_id, role_dict):
return ''
role_type = role_dict.get(role_id).type
if system_role == role_type:
return RoleConstants.EXTENDS_ADMIN.value.name
return [RoleConstants.EXTENDS_ADMIN.value.name]
return [f"EXTENDS_{role_type}:/WORKSPACE/{workspace_id}", f"EXTENDS_{role_type}"]