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): def reset_workspace_role(role_id, workspace_id, role_dict):
if system_role_list.__contains__(role_id): if system_role_list.__contains__(role_id):
if system_role == role_id: if system_role == role_id:
return role_id return [role_id]
else: else:
return [f"{role_id}:/WORKSPACE/{workspace_id}", role_id] return [f"{role_id}:/WORKSPACE/{workspace_id}", role_id]
else: else:
@ -238,7 +238,7 @@ def reset_workspace_role(role_id, workspace_id, role_dict):
return '' return ''
role_type = role_dict.get(role_id).type role_type = role_dict.get(role_id).type
if system_role == role_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}"] return [f"EXTENDS_{role_type}:/WORKSPACE/{workspace_id}", f"EXTENDS_{role_type}"]