Package org.openurp.app.security.service
Class CacheableAuthorityManager
- java.lang.Object
-
- org.beangle.commons.dao.impl.BaseServiceImpl
-
- org.openurp.app.security.service.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 Summary
Fields Modifier and Type Field Description protected Map<String,Set<?>>authorities角色权限protected RemoteAuthorityServiceauthorityServiceprotected Set<String>ignoresprotected Set<?>protectedResources公有资源namesprotected Set<String>publicResources公开资源nameprotected Set<String>roots
-
Constructor Summary
Constructors Constructor Description CacheableAuthorityManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()booleanisAuthorized(org.beangle.security.core.context.SecurityContext context)资源是否被授权
1)检查是否是属于公有资源
2)检查角色权限booleanisAuthorized(org.beangle.security.core.context.SecurityContext context, org.beangle.commons.security.Request request)booleanisRoot(String user)voidrefreshCache()加载三类资源Set<?>refreshRolePermissions(String authority)voidsetAuthorityService(RemoteAuthorityService authorityService)voidsetIgnores(Set<String> ignores)
-
-
-
Field Detail
-
protectedResources
protected Set<?> protectedResources
公有资源names
-
authorityService
protected RemoteAuthorityService authorityService
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(org.beangle.security.core.context.SecurityContext context)
资源是否被授权
1)检查是否是属于公有资源
2)检查角色权限- Specified by:
isAuthorizedin interfaceorg.beangle.security.access.AuthorityManager
-
isAuthorized
public boolean isAuthorized(org.beangle.security.core.context.SecurityContext context, org.beangle.commons.security.Request request)- Specified by:
isAuthorizedin interfaceorg.beangle.security.access.AuthorityManager
-
refreshCache
public void refreshCache()
加载三类资源
-
init
public void init() throws Exception- Specified by:
initin interfaceorg.beangle.commons.bean.Initializing- Throws:
Exception
-
setAuthorityService
public void setAuthorityService(RemoteAuthorityService authorityService)
-
isRoot
public boolean isRoot(String user)
- Specified by:
isRootin interfaceorg.beangle.security.access.AuthorityManager
-
-