Class ManagerAuthRealm

java.lang.Object
org.apache.shiro.realm.CachingRealm
org.apache.shiro.realm.AuthenticatingRealm
org.apache.shiro.realm.AuthorizingRealm
net.mingsoft.basic.realm.BaseAuthRealm
net.mingsoft.basic.realm.ManagerAuthRealm
All Implemented Interfaces:
org.apache.shiro.authc.LogoutAware, org.apache.shiro.authz.Authorizer, org.apache.shiro.authz.permission.PermissionResolverAware, org.apache.shiro.authz.permission.RolePermissionResolverAware, org.apache.shiro.cache.CacheManagerAware, org.apache.shiro.lang.util.Initializable, org.apache.shiro.lang.util.Nameable, org.apache.shiro.realm.Realm

public class ManagerAuthRealm extends BaseAuthRealm
管理员shiro权限控制
Version:
版本号:
创建日期:2015年9月9日
历史修订:
Author:
铭软团队
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.shiro.authc.AuthenticationInfo
    doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
    新登用户验证
    protected org.apache.shiro.authz.AuthorizationInfo
    doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principalCollection)
    功能操作授权
    boolean
    hasRole(org.apache.shiro.subject.PrincipalCollection principals, String roleIdentifier)
    检查当前登录人是否有角色
    boolean
    isPermitted(org.apache.shiro.subject.PrincipalCollection principals, String permission)
    检查当前登陆人是否有权限
    boolean
    supports(org.apache.shiro.authc.AuthenticationToken token)
    多realm下支持查询当前realm类是否是正确的角色授权类

    Methods inherited from class net.mingsoft.basic.realm.BaseAuthRealm

    clearAllCachedAuthorizationInfo, clearCachedAuthorizationInfo

    Methods inherited from class org.apache.shiro.realm.AuthorizingRealm

    afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, onInit, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver

    Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm

    assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher

    Methods inherited from class org.apache.shiro.realm.CachingRealm

    clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.shiro.lang.util.Initializable

    init
  • Constructor Details

    • ManagerAuthRealm

      public ManagerAuthRealm()
  • Method Details

    • doGetAuthenticationInfo

      protected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token) throws org.apache.shiro.authc.AuthenticationException
      新登用户验证
      Specified by:
      doGetAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealm
      Throws:
      org.apache.shiro.authc.AuthenticationException
    • doGetAuthorizationInfo

      protected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principalCollection)
      功能操作授权
      Specified by:
      doGetAuthorizationInfo in class org.apache.shiro.realm.AuthorizingRealm
    • supports

      public boolean supports(org.apache.shiro.authc.AuthenticationToken token)
      多realm下支持查询当前realm类是否是正确的角色授权类
      Specified by:
      supports in interface org.apache.shiro.realm.Realm
      Overrides:
      supports in class org.apache.shiro.realm.AuthenticatingRealm
      Parameters:
      token - the token being submitted for authentication.
      Returns:
    • isPermitted

      public boolean isPermitted(org.apache.shiro.subject.PrincipalCollection principals, String permission)
      检查当前登陆人是否有权限
      Specified by:
      isPermitted in interface org.apache.shiro.authz.Authorizer
      Overrides:
      isPermitted in class org.apache.shiro.realm.AuthorizingRealm
      Parameters:
      principals - the application-specific subject/user identifier.
      permission - the String representation of a Permission that is being checked.
      Returns:
    • hasRole

      public boolean hasRole(org.apache.shiro.subject.PrincipalCollection principals, String roleIdentifier)
      检查当前登录人是否有角色
      Specified by:
      hasRole in interface org.apache.shiro.authz.Authorizer
      Overrides:
      hasRole in class org.apache.shiro.realm.AuthorizingRealm
      Parameters:
      principals - the application-specific subject/user identifier.
      roleIdentifier - the application-specific role identifier (usually a role id or role name).
      Returns: