mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-05 12:23:29 +08:00
删除无用代码
This commit is contained in:
@@ -25,7 +25,6 @@ import org.apache.shiro.authc.SimpleAuthenticationInfo;
|
||||
import org.apache.shiro.authz.AuthorizationInfo;
|
||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||
import org.apache.shiro.authz.permission.WildcardPermission;
|
||||
import org.apache.shiro.cache.Cache;
|
||||
import org.apache.shiro.realm.AuthorizingRealm;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
@@ -72,14 +71,6 @@ public class ListenerAuthorizingRealm extends AuthorizingRealm
|
||||
SecurityUtils.getSubject().logout();
|
||||
}
|
||||
|
||||
protected <K, V> Cache<K, V> getCache(String name) {
|
||||
return getCacheManager().getCache(getCacheName(name));
|
||||
}
|
||||
|
||||
protected String getCacheName(String name) {
|
||||
return "shiro.auth.info.".concat(name);
|
||||
}
|
||||
|
||||
protected AuthorizationInfo createAuthorizationInfo(Authentication authentication) {
|
||||
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
|
||||
authorizationInfo.addRoles(authentication.getRoles().stream().map(Role::getId).collect(Collectors.toList()));
|
||||
@@ -104,4 +95,5 @@ public class ListenerAuthorizingRealm extends AuthorizingRealm
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
subject.login(new SimpleAuthenticationToken(authentication, remember));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user