org.jboss.security.acl
public class RoleBasedACLProviderImpl extends ACLProviderImpl
Implementation of ACLProvider
that uses the identity roles when checking if access to a protected resource
should be granted or not. If no roles are associated with the specified identity, then the default implementation,
which is based on the identity name, is used. Otherwise, #isAccessGranted()
iterates over the roles and if
one of the roles has sufficient permissions, then access is granted.
strategy
Constructor and Description |
---|
RoleBasedACLProviderImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
getAllRoles(Role role,
List<Role> roles)
This method traverses the role tree that has the specified root role and puts all simple (i.e.
|
<T> Set<T> |
getEntitlements(Class<T> clazz,
Resource resource,
Identity identity) |
boolean |
isAccessGranted(Resource resource,
Identity identity,
ACLPermission permission)
This method overrides the default implementation to use roles instead of the identity name when checking for
permissions.
|
fillEntitlements, getInitialPermissions, getPersistenceStrategy, initialize, loadClass, setPersistenceStrategy, tearDown
public <T> Set<T> getEntitlements(Class<T> clazz, Resource resource, Identity identity) throws AuthorizationException
getEntitlements
in interface ACLProvider
getEntitlements
in class ACLProviderImpl
AuthorizationException
public boolean isAccessGranted(Resource resource, Identity identity, ACLPermission permission) throws AuthorizationException
This method overrides the default implementation to use roles instead of the identity name when checking for permissions. If the specified identity has one or more roles associated with it, this implementation will use these roles to check if the identity should be granted access to the resource or not.
isAccessGranted
in interface ACLProvider
isAccessGranted
in class ACLProviderImpl
AuthorizationException
protected void getAllRoles(Role role, List<Role> roles)
This method traverses the role tree that has the specified root role and puts all simple (i.e. not an instance of RoleGroup) roles into the specified roles list.
role
- the root of the role tree.roles
- the List<Role>
that contains the simple roles of the tree.Copyright © 2015 JBoss Inc.. All Rights Reserved.