File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
apps/common/auth/handle/impl Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -218,11 +218,12 @@ def get_role_list(user,
218218 if is_query_model :
219219 # 获取工作空间 用户 角色映射数据
220220 workspace_user_role_mapping_list = QuerySet (workspace_user_role_mapping_model ).filter (user_id = user .id )
221- cache .set (key ,
222- [f"{ workspace_user_role_mapping .role_id } :/WORKSPACE/{ workspace_user_role_mapping .workspace_id } "
223- for
224- workspace_user_role_mapping in
225- workspace_user_role_mapping_list ] + [user .role ], version = version )
221+ workspace_list = [
222+ f"{ workspace_user_role_mapping .role_id } :/WORKSPACE/{ workspace_user_role_mapping .workspace_id } "
223+ for
224+ workspace_user_role_mapping in
225+ workspace_user_role_mapping_list ] + [user .role ]
226+ cache .set (key , workspace_list , version = version )
226227 else :
227228 role_list = [user .role ]
228229 if user .role == RoleConstants .ADMIN .value .__str__ ():
Original file line number Diff line number Diff line change @@ -18,11 +18,13 @@ const workspaceApiMap = {
1818 */
1919
2020export function loadPermissionApi ( type : string ) {
21- if ( hasPermission ( [ EditionConst . IS_EE , RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ] , 'AND' ) ) {
22- // 加载企业版工作空间管理员 API
23- return workspaceApiMap [ type ]
24- } else {
25- // 加载系统管理员 API
26- return systemApiMap [ type ]
21+ if ( hasPermission ( EditionConst . IS_EE , 'OR' ) ) {
22+ if ( hasPermission ( [ RoleConst . ADMIN ] , 'OR' ) ) {
23+ // 加载企业版工作空间管理员 API
24+ return systemApiMap [ type ]
25+ } else if ( hasPermission ( [ RoleConst . WORKSPACE_MANAGE . getWorkspaceRole ] , 'OR' ) ) {
26+ // 加载系统管理员 API
27+ return workspaceApiMap [ type ]
28+ }
2729 }
2830}
You can’t perform that action at this time.
0 commit comments