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

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

......@@ -38,38 +38,8 @@
create_time,
panel_type,
`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
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>
FIND_IN_SET(panel_group.id,cids)
<if test="name != null">
......
......@@ -191,8 +191,7 @@ delimiter ;
-- ----------------------------
DROP FUNCTION IF EXISTS `get_auths`;
delimiter ;;
CREATE FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255))
RETURNS longtext CHARSET utf8
CREATE DEFINER=`root`@`%` FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255)) RETURNS longtext CHARSET utf8
READS SQL DATA
BEGIN
......@@ -211,7 +210,7 @@ FROM
AND (
(
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 (
sys_auth.auth_target_type = 'user'
......@@ -219,7 +218,7 @@ FROM
)
OR (
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
......@@ -303,8 +302,6 @@ delimiter ;
-- ----------------------------
-- 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
READS SQL DATA
BEGIN
......@@ -324,7 +321,7 @@ SELECT
AND (
(
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 (
sys_auth.auth_target_type = 'user'
......@@ -332,7 +329,7 @@ SELECT
)
OR (
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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论