提交 ead3efce authored 作者: taojinlong's avatar taojinlong

Merge branch 'main' of github.com:dataease/dataease into main

...@@ -38,38 +38,8 @@ ...@@ -38,38 +38,8 @@
create_time, create_time,
panel_type, panel_type,
`name` AS label, `name` AS label,
authInfo.`privileges` get_auths(id,'panel',#{userId}) as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
left join
(SELECT
`sys_auth`.`auth_source` AS `auth_source`,
`sys_auth`.`auth_source_type` AS `auth_source_type`,
group_concat( 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_target_type = 'dept'
AND sys_auth.auth_target = ( 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 = ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`,
`sys_auth`.`auth_source_type`) authInfo
on panel_group.id = authInfo.auth_source and authInfo.auth_source_type='panel'
<where> <where>
FIND_IN_SET(panel_group.id,cids) FIND_IN_SET(panel_group.id,cids)
<if test="name != null"> <if test="name != null">
......
...@@ -191,9 +191,8 @@ delimiter ; ...@@ -191,9 +191,8 @@ delimiter ;
-- ---------------------------- -- ----------------------------
DROP FUNCTION IF EXISTS `get_auths`; DROP FUNCTION IF EXISTS `get_auths`;
delimiter ;; delimiter ;;
CREATE FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255)) CREATE DEFINER=`root`@`%` FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255)) RETURNS longtext CHARSET utf8
RETURNS longtext CHARSET utf8 READS SQL DATA
READS SQL DATA
BEGIN BEGIN
DECLARE oTemp longtext; DECLARE oTemp longtext;
...@@ -211,7 +210,7 @@ FROM ...@@ -211,7 +210,7 @@ FROM
AND ( AND (
( (
sys_auth.auth_target_type = 'dept' sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target = ( SELECT dept_id FROM sys_user WHERE user_id = userId ) AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId )
) )
OR ( OR (
sys_auth.auth_target_type = 'user' sys_auth.auth_target_type = 'user'
...@@ -219,7 +218,7 @@ FROM ...@@ -219,7 +218,7 @@ FROM
) )
OR ( OR (
sys_auth.auth_target_type = 'role' sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target = ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ) AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId )
) )
) )
GROUP BY GROUP BY
...@@ -303,8 +302,6 @@ delimiter ; ...@@ -303,8 +302,6 @@ delimiter ;
-- ---------------------------- -- ----------------------------
-- Function structure for GET_V_AUTH_MODEL_ID_P_USE -- Function structure for GET_V_AUTH_MODEL_ID_P_USE
-- ---------------------------- -- ----------------------------
DROP FUNCTION IF EXISTS `GET_V_AUTH_MODEL_ID_P_USE`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `GET_V_AUTH_MODEL_ID_P_USE`(userId longtext,modelType varchar(255)) RETURNS longtext CHARSET utf8 CREATE DEFINER=`root`@`%` FUNCTION `GET_V_AUTH_MODEL_ID_P_USE`(userId longtext,modelType varchar(255)) RETURNS longtext CHARSET utf8
READS SQL DATA READS SQL DATA
BEGIN BEGIN
...@@ -324,7 +321,7 @@ SELECT ...@@ -324,7 +321,7 @@ SELECT
AND ( AND (
( (
sys_auth.auth_target_type = 'dept' sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target = ( SELECT dept_id FROM sys_user WHERE user_id = userId ) AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId )
) )
OR ( OR (
sys_auth.auth_target_type = 'user' sys_auth.auth_target_type = 'user'
...@@ -332,7 +329,7 @@ SELECT ...@@ -332,7 +329,7 @@ SELECT
) )
OR ( OR (
sys_auth.auth_target_type = 'role' sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target = ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ) AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId )
) )
) )
GROUP BY GROUP BY
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论