2021SC@SDUSC
SimpleAccountRealm的类继承关系图
6. AuthorizingRealm
-
AuthorizingRealm的变量
authorizationCachingEnabled:授权缓存器是否可用
authorizationCache:授权缓存器,是一个Cache集合
authorizationCacheName:授权缓存器的名称
permissionResolver:权限处理器,主要用来处理传过来的权限信息,根据给定的字符串表示解析权限。
permissionRoleResolver:主要是用来处理角色对应的权限,根据角色获取角色对应的权限集合 -
AuthorizingRealm的函数方法
-
AuthorizingRealm()
public AuthorizingRealm() {
//调用双参构造函数
this(null, null);
}
public AuthorizingRealm(CacheManager cacheManager) {
//调用双参构造函数
this(cacheManager, null);
}
public AuthorizingRealm(CredentialsMatcher matcher) {
//调用双参构造函数
this(null, matcher);
}
public AuthorizingRealm(CacheManager cacheManager, CredentialsMatcher matcher) {
super();
//设置缓存管理器
if (cacheManager != null) setCacheManager(cacheManager);
//设置凭证验证器
if (matcher != null) setCredentialsMatcher(matcher);
//将authorizationCachingEnabled 默认设置为true
this.authorizationCachingEnabled = true;
this.permissionResolver = new WildcardPermissionResolver();
int instanceNumber