diff --git a/src/main/java/com/rymcu/vertical/config/BaseShiroRealm.java b/src/main/java/com/rymcu/vertical/config/BaseShiroRealm.java index 7c88b93..1a0126b 100644 --- a/src/main/java/com/rymcu/vertical/config/BaseShiroRealm.java +++ b/src/main/java/com/rymcu/vertical/config/BaseShiroRealm.java @@ -42,8 +42,6 @@ public class BaseShiroRealm extends AuthorizingRealm { @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { - //Principal principal = (Principal) getAvailablePrincipal(principals); -// System.out.println("权限配置-->MyShiroRealm.doGetAuthorizationInfo()"); SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo(); Principal principal = (Principal)principals.getPrimaryPrincipal(); User user = new User(); @@ -55,7 +53,7 @@ public class BaseShiroRealm extends AuthorizingRealm { authorizationInfo.addRole(role.getInputCode()); } } - List permissions = permissionService.selectMenuByUser(user); + List permissions = permissionService.selectPermissionByUser(user); for (Permission perm : permissions) { if (perm.getPermissionCategory() != null) { authorizationInfo.addStringPermission(perm.getPermissionCategory()); diff --git a/src/main/java/com/rymcu/vertical/service/PermissionService.java b/src/main/java/com/rymcu/vertical/service/PermissionService.java index 74eea8c..bf577d1 100644 --- a/src/main/java/com/rymcu/vertical/service/PermissionService.java +++ b/src/main/java/com/rymcu/vertical/service/PermissionService.java @@ -14,5 +14,10 @@ import java.util.List; */ public interface PermissionService extends Service { - List selectMenuByUser(User sysUser); + /** + * 获取用户权限 + * @param sysUser + * @return + */ + List selectPermissionByUser(User sysUser); } diff --git a/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java index 0631561..4e42d2b 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/PermissionServiceImpl.java @@ -17,10 +17,11 @@ import java.util.List; /** - * Created by CodeGenerator on 2018/05/29. + * + * @author CodeGenerator + * @date 2018/05/29 */ @Service -@Transactional public class PermissionServiceImpl extends AbstractService implements PermissionService { @Resource private PermissionMapper permissionMapper; @@ -29,7 +30,7 @@ public class PermissionServiceImpl extends AbstractService implement private RoleService roleService; @Override - public List selectMenuByUser(User sysUser) { + public List selectPermissionByUser(User sysUser) { List list = new ArrayList(); List roles = roleService.selectRoleByUser(sysUser); roles.forEach(role -> list.addAll(permissionMapper.selectMenuByIdRole(role.getIdRole())));