diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java index 523ed46b..d9e5fecd 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java @@ -115,12 +115,6 @@ public class SysRole extends BaseEntity { @TableField(exist = false) private Long[] deptIds; - /** - * 角色菜单权限 - */ - @TableField(exist = false) - private Set permissions; - public SysRole(Long roleId) { this.roleId = roleId; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java index d500c198..3b650ecf 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java @@ -1,7 +1,6 @@ package com.ruoyi.system.service.impl; import com.ruoyi.common.satoken.utils.LoginHelper; -import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysPermissionService; @@ -10,7 +9,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.HashSet; -import java.util.List; import java.util.Set; /** @@ -56,17 +54,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService { if (LoginHelper.isAdmin(user.getUserId())) { perms.add("*:*:*"); } else { - List roles = user.getRoles(); - if (!roles.isEmpty() && roles.size() > 1) { - // 多角色设置permissions属性,以便数据权限匹配权限 - for (SysRole role : roles) { - Set rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); - role.setPermissions(rolePerms); - perms.addAll(rolePerms); - } - } else { - perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); - } + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); } return perms; }