Class CacheableAuthorityManager

  • All Implemented Interfaces:
    org.beangle.commons.bean.Initializing, org.beangle.security.access.AuthorityManager

    public class CacheableAuthorityManager
    extends org.beangle.commons.dao.impl.BaseServiceImpl
    implements org.beangle.security.access.AuthorityManager, org.beangle.commons.bean.Initializing
    • Field Detail

      • authorities

        protected Map<String,​Set<?>> authorities
        角色权限
      • publicResources

        protected Set<String> publicResources
        公开资源name
      • protectedResources

        protected Set<?> protectedResources
        公有资源names
    • Constructor Detail

      • CacheableAuthorityManager

        public CacheableAuthorityManager()
    • Method Detail

      • isAuthorized

        public boolean isAuthorized​(org.beangle.security.core.context.SecurityContext context)
        资源是否被授权
        1)检查是否是属于公有资源
        2)检查角色权限
        Specified by:
        isAuthorized in interface org.beangle.security.access.AuthorityManager
      • isAuthorized

        public boolean isAuthorized​(org.beangle.security.core.context.SecurityContext context,
                                    org.beangle.commons.security.Request request)
        Specified by:
        isAuthorized in interface org.beangle.security.access.AuthorityManager
      • refreshRolePermissions

        public Set<?> refreshRolePermissions​(String authority)
      • refreshCache

        public void refreshCache()
        加载三类资源
      • init

        public void init()
                  throws Exception
        Specified by:
        init in interface org.beangle.commons.bean.Initializing
        Throws:
        Exception
      • isRoot

        public boolean isRoot​(String user)
        Specified by:
        isRoot in interface org.beangle.security.access.AuthorityManager
      • setIgnores

        public void setIgnores​(Set<String> ignores)