Class AclEntryAfterInvocationProvider
- java.lang.Object
-
- org.springframework.security.acls.afterinvocation.AbstractAclProvider
-
- org.springframework.security.acls.afterinvocation.AclEntryAfterInvocationProvider
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.MessageSourceAware
,AfterInvocationProvider
public class AclEntryAfterInvocationProvider extends AbstractAclProvider implements org.springframework.context.MessageSourceAware
Given a domain object instance returned from a secure object invocation, ensures the principal has appropriate permission as defined by theAclService
.The
AclService
is used to retrieve the access control list (ACL) permissions associated with a domain object instance for the currentAuthentication
object.This after invocation provider will fire if any
ConfigAttribute.getAttribute()
matches theAbstractAclProvider.processConfigAttribute
. The provider will then lookup the ACLs from the AclService and ensure the principal isAcl.isGranted(List, List, boolean)
when presenting theAbstractAclProvider.requirePermission
array to that method.Often users will set up an
AclEntryAfterInvocationProvider
with aAbstractAclProvider.processConfigAttribute
ofAFTER_ACL_READ
and aAbstractAclProvider.requirePermission
ofBasePermission.READ
. These are also the defaults.If the principal does not have sufficient permissions, an
AccessDeniedException
will be thrown.If the provided returnedObject is
null
, permission will always be granted andnull
will be returned.All comparisons and prefixes are case sensitive.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
logger
protected org.springframework.context.support.MessageSourceAccessor
messages
-
Fields inherited from class org.springframework.security.acls.afterinvocation.AbstractAclProvider
aclService, objectIdentityRetrievalStrategy, processConfigAttribute, processDomainObjectClass, requirePermission, sidRetrievalStrategy
-
-
Constructor Summary
Constructors Constructor Description AclEntryAfterInvocationProvider(AclService aclService, java.lang.String processConfigAttribute, java.util.List<Permission> requirePermission)
AclEntryAfterInvocationProvider(AclService aclService, java.util.List<Permission> requirePermission)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decide(Authentication authentication, java.lang.Object object, java.util.Collection<ConfigAttribute> config, java.lang.Object returnedObject)
void
setMessageSource(org.springframework.context.MessageSource messageSource)
-
Methods inherited from class org.springframework.security.acls.afterinvocation.AbstractAclProvider
getProcessDomainObjectClass, hasPermission, setObjectIdentityRetrievalStrategy, setProcessConfigAttribute, setProcessDomainObjectClass, setSidRetrievalStrategy, supports, supports
-
-
-
-
Constructor Detail
-
AclEntryAfterInvocationProvider
public AclEntryAfterInvocationProvider(AclService aclService, java.util.List<Permission> requirePermission)
-
AclEntryAfterInvocationProvider
public AclEntryAfterInvocationProvider(AclService aclService, java.lang.String processConfigAttribute, java.util.List<Permission> requirePermission)
-
-
Method Detail
-
decide
public java.lang.Object decide(Authentication authentication, java.lang.Object object, java.util.Collection<ConfigAttribute> config, java.lang.Object returnedObject) throws AccessDeniedException
- Specified by:
decide
in interfaceAfterInvocationProvider
- Throws:
AccessDeniedException
-
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
- Specified by:
setMessageSource
in interfaceorg.springframework.context.MessageSourceAware
-
-