|
|
@@ -1,6 +1,8 @@
|
|
|
package com.kede.core.shiro.token;
|
|
|
|
|
|
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import org.apache.shiro.authc.AuthenticationException;
|
|
|
@@ -9,6 +11,7 @@ import org.apache.shiro.authc.AuthenticationToken;
|
|
|
import org.apache.shiro.authc.SimpleAuthenticationInfo;
|
|
|
import org.apache.shiro.authc.UnknownAccountException;
|
|
|
import org.apache.shiro.authz.AuthorizationInfo;
|
|
|
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
|
|
import org.apache.shiro.realm.AuthorizingRealm;
|
|
|
import org.apache.shiro.subject.PrincipalCollection;
|
|
|
import org.apache.shiro.subject.SimplePrincipalCollection;
|
|
|
@@ -74,14 +77,14 @@ public class UserRealm extends AuthorizingRealm {
|
|
|
@Override
|
|
|
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
|
|
|
String userId = TokenManager.getAdminId();
|
|
|
- /*SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
|
|
- // 根据用户ID查询角色(role),放入到Authorization里。
|
|
|
- Set<String> roles = roleService.findRoleByUserId(userId);
|
|
|
- info.setRoles(roles);
|
|
|
- // 根据用户ID查询权限(permission),放入到Authorization里。
|
|
|
- Set<String> permissions = permissionService.findPermissionByUserId(userId);
|
|
|
- info.setStringPermissions(permissions);
|
|
|
- return info;*/
|
|
|
+ SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
|
|
+// 根据用户ID查询角色(role),放入到Authorization里。
|
|
|
+// Set<String> roles = roleService.findRoleByUserId(userId);
|
|
|
+// info.setRoles(roles);
|
|
|
+// 根据用户ID查询权限(permission),放入到Authorization里。
|
|
|
+// Set<String> permissions = permissionService.findPermissionByUserId(userId);
|
|
|
+// info.setStringPermissions(permissions);
|
|
|
+// return info;
|
|
|
return null;
|
|
|
}
|
|
|
|