You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<select id="queryByUser" parameterType="Object" resultMap="SysPermission">
SELECT * FROM (
SELECT p.*
FROM sys_permission p
WHERE (exists(
select a.id from sys_role_permission a
join sys_role b on a.role_id = b.id
join sys_user_role c on c.role_id = b.id
join sys_user d on d.id = c.user_id
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
)
or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1)
or p.url = '/online')
and p.del_flag = 0
<!--update begin Author:lvdandan Date:20200213 for:加入部门权限 -->
UNION
SELECT p.*
FROM sys_permission p
WHERE exists(
select a.id from sys_depart_role_permission a
join sys_depart_role b on a.role_id = b.id
join sys_depart_role_user c on c.drole_id = b.id
join sys_user d on d.id = c.user_id
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
)
and p.del_flag = 0
<!--update end Author:lvdandan Date:20200213 for:加入部门权限 -->
) h order by h.sort_no ASC
</select>>
建议在此位置加入部门过滤子句。
友情提示: 未按格式要求发帖,会直接删掉。
The text was updated successfully, but these errors were encountered:
版本号:2.4.3
问题描述:用户具有A、B两个部门时,A部门可看菜单1,B部门可看菜单2,在给用户分配了相应权限后,无论怎么切换,均可同时看到菜单1和菜单2,我认为还是切换不同部门看不同菜单好一些。
追踪了代码后发现,问题在SysPermissionMapper.xml的queryByUser方法里,方法如下:
建议在此位置加入部门过滤子句。
友情提示: 未按格式要求发帖,会直接删掉。
The text was updated successfully, but these errors were encountered: