diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index 8ebf604a00..0e9361b330 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -63,12 +63,13 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/tokenExpired", ANON); filterChainDefinitionMap.put("/downline", ANON); filterChainDefinitionMap.put("/common-files/**", ANON); - + filterChainDefinitionMap.put("/linkage/getPanelAllLinkageInfo/**", ANON); filterChainDefinitionMap.put("/api/auth/logout", "logout"); filterChainDefinitionMap.put("/api/link/resourceDetail/**", "link"); filterChainDefinitionMap.put("/api/link/viewDetail/**", "link"); + filterChainDefinitionMap.put("/**", "authc"); filterChainDefinitionMap.put("/**", "jwt"); diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml index dfe3e343ed..92b95a8832 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml @@ -12,8 +12,39 @@ select id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label, - get_auths(id,'dataset',#{userId}) as `privileges` + authInfo.privileges as `privileges` from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_group + left join ( + SELECT + auth_source, + group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges` + FROM + ( + `sys_auth` + LEFT JOIN `sys_auth_detail` ON (( + `sys_auth`.`id` = `sys_auth_detail`.`auth_id` + ))) + WHERE + sys_auth_detail.privilege_value = 1 + AND sys_auth.auth_source_type = 'dataset' + AND ( + ( + sys_auth.auth_target_type = 'dept' + AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} ) + ) + OR ( + sys_auth.auth_target_type = 'user' + AND sys_auth.auth_target = #{userId} + ) + OR ( + sys_auth.auth_target_type = 'role' + AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} ) + ) + ) + GROUP BY + `sys_auth`.`auth_source` + ) authInfo + on dataset_group.id = authInfo.auth_source FIND_IN_SET(dataset_group.id,cids) diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml index be315eb38d..230f89883c 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml @@ -38,8 +38,39 @@ select id , name , `desc` ,`type` , configuration ,create_time ,update_time, - get_auths(id,'link',#{extendCondition}) as `privileges` + authInfo.privileges as `privileges` from (select GET_V_AUTH_MODEL_ID_P_USE (#{extendCondition}, 'link') cids) t,datasource + left join ( + SELECT + auth_source, + group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges` + FROM + ( + `sys_auth` + LEFT JOIN `sys_auth_detail` ON (( + `sys_auth`.`id` = `sys_auth_detail`.`auth_id` + ))) + WHERE + sys_auth_detail.privilege_value = 1 + AND sys_auth.auth_source_type = 'link' + AND ( + ( + sys_auth.auth_target_type = 'dept' + AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{extendCondition} ) + ) + OR ( + sys_auth.auth_target_type = 'user' + AND sys_auth.auth_target = #{extendCondition} + ) + OR ( + sys_auth.auth_target_type = 'role' + AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{extendCondition} ) + ) + ) + GROUP BY + `sys_auth`.`auth_source` + ) authInfo + on datasource.id = authInfo.auth_source @@ -25,8 +56,39 @@