| | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private ZfAncestorService zfService; |
| | | |
| | | /** |
| | | * 获取角色数据权限 |
| | | * |
| | |
| | | public Set<String> getRolePermission(SysUser user) |
| | | { |
| | | Set<String> roles = new HashSet<String>(); |
| | | |
| | | // 管理员拥有所有权限 |
| | | if (user.isAdmin()) |
| | | { |
| | |
| | | { |
| | | Set<String> perms = new HashSet<String>(); |
| | | // 管理员拥有所有权限 |
| | | if (user.isAdmin()) |
| | | ZfAncestor zfAncestor = new ZfAncestor(); |
| | | zfAncestor.setSysId(user.getUserId()); |
| | | zfAncestor = zfService.selectZfAncestor(zfAncestor); |
| | | // System.out.println("---------++++++++____________"); |
| | | // System.out.println(zfAncestor); |
| | | // //判断是否是超级管理员 |
| | | if(zfAncestor!=null) |
| | | { |
| | | // perms.add("system:*:*"); |
| | | perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); |
| | | perms.add("*:*:*"); |
| | | // perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); |
| | | |
| | | } |
| | | else |