mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 角色权限支持仅本人权限查看 解决无法查看自己创建的角色问题
This commit is contained in:
		@@ -20,7 +20,8 @@ import java.util.List;
 | 
				
			|||||||
public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
 | 
					public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @DataPermission({
 | 
					    @DataPermission({
 | 
				
			||||||
        @DataColumn(key = "deptName", value = "d.dept_id")
 | 
					        @DataColumn(key = "deptName", value = "d.dept_id"),
 | 
				
			||||||
 | 
					        @DataColumn(key = "userName", value = "r.create_by")
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    Page<SysRoleVo> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper);
 | 
					    Page<SysRoleVo> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,12 +32,14 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
 | 
				
			|||||||
     * @return 角色数据集合信息
 | 
					     * @return 角色数据集合信息
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @DataPermission({
 | 
					    @DataPermission({
 | 
				
			||||||
        @DataColumn(key = "deptName", value = "d.dept_id")
 | 
					        @DataColumn(key = "deptName", value = "d.dept_id"),
 | 
				
			||||||
 | 
					        @DataColumn(key = "userName", value = "r.create_by")
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper);
 | 
					    List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @DataPermission({
 | 
					    @DataPermission({
 | 
				
			||||||
        @DataColumn(key = "deptName", value = "d.dept_id")
 | 
					        @DataColumn(key = "deptName", value = "d.dept_id"),
 | 
				
			||||||
 | 
					        @DataColumn(key = "userName", value = "r.create_by")
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    SysRoleVo selectRoleById(Long roleId);
 | 
					    SysRoleVo selectRoleById(Long roleId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,7 +49,13 @@
 | 
				
			|||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
 | 
					    <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
 | 
				
			||||||
        <include refid="selectRoleVo"/>
 | 
					        select r.role_id,
 | 
				
			||||||
 | 
					               r.role_name,
 | 
				
			||||||
 | 
					               r.role_key,
 | 
				
			||||||
 | 
					               r.role_sort,
 | 
				
			||||||
 | 
					        from sys_role r
 | 
				
			||||||
 | 
					                 left join sys_user_role sur on sur.role_id = r.role_id
 | 
				
			||||||
 | 
					                 left join sys_user u on u.user_id = sur.user_id
 | 
				
			||||||
        WHERE r.del_flag = '0' and u.user_name = #{userName}
 | 
					        WHERE r.del_flag = '0' and u.user_name = #{userName}
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user