Class AclEntryAfterInvocationCollectionFilteringProvider
- java.lang.Object
-
- org.springframework.security.acls.afterinvocation.AbstractAclProvider
-
- org.springframework.security.acls.afterinvocation.AclEntryAfterInvocationCollectionFilteringProvider
-
- All Implemented Interfaces:
org.springframework.security.access.AfterInvocationProvider
public class AclEntryAfterInvocationCollectionFilteringProvider extends AbstractAclProvider
Given a
Collectionof domain object instances returned from a secure object invocation, remove anyCollectionelements the principal does not have appropriate permission to access as defined by theAclService.The
AclServiceis used to retrieve the access control list (ACL) permissions associated with eachCollectiondomain object instance element for the currentAuthenticationobject.This after invocation provider will fire if any
ConfigAttribute.getAttribute()matches theAbstractAclProvider.processConfigAttribute. The provider will then lookup the ACLs from theAclServiceand ensure the principal isAcl.isGranted()when presenting theAbstractAclProvider.requirePermissionarray to that method.If the principal does not have permission, that element will not be included in the returned
Collection.Often users will setup a
BasicAclEntryAfterInvocationProviderwith aAbstractAclProvider.processConfigAttributeofAFTER_ACL_COLLECTION_READand aAbstractAclProvider.requirePermissionofBasePermission.READ. These are also the defaults.If the provided
returnObjectisnull, anullCollectionwill be returned. If the providedreturnObjectis not aCollection, anAuthorizationServiceExceptionwill be thrown.All comparisons and prefixes are case sensitive.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Loglogger-
Fields inherited from class org.springframework.security.acls.afterinvocation.AbstractAclProvider
aclService, objectIdentityRetrievalStrategy, processConfigAttribute, processDomainObjectClass, requirePermission, sidRetrievalStrategy
-
-
Constructor Summary
Constructors Constructor Description AclEntryAfterInvocationCollectionFilteringProvider(AclService aclService, java.util.List<Permission> requirePermission)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdecide(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> config, java.lang.Object returnedObject)-
Methods inherited from class org.springframework.security.acls.afterinvocation.AbstractAclProvider
getProcessDomainObjectClass, hasPermission, setObjectIdentityRetrievalStrategy, setProcessConfigAttribute, setProcessDomainObjectClass, setSidRetrievalStrategy, supports, supports
-
-
-
-
Constructor Detail
-
AclEntryAfterInvocationCollectionFilteringProvider
public AclEntryAfterInvocationCollectionFilteringProvider(AclService aclService, java.util.List<Permission> requirePermission)
-
-
Method Detail
-
decide
public java.lang.Object decide(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> config, java.lang.Object returnedObject) throws org.springframework.security.access.AccessDeniedException- Throws:
org.springframework.security.access.AccessDeniedException
-
-