public class

AclPermissionEvaluator

extends Object
implements PermissionEvaluator
java.lang.Object
   ↳ org.springframework.security.acls.AclPermissionEvaluator

Class Overview

Used by Spring Security's expression-based access control implementation to evaluate permissions for a particular object using the ACL module. Similar in behaviour to AclEntryVoter.

Summary

Public Constructors
AclPermissionEvaluator(AclService aclService)
Public Methods
boolean hasPermission(Authentication authentication, Object domainObject, Object permission)
Determines whether the user has the given permission(s) on the domain object using the ACL configuration.
boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission)
Alternative method for evaluating a permission where only the identifier of the target object is available, rather than the target instance itself.
void setObjectIdentityGenerator(ObjectIdentityGenerator objectIdentityGenerator)
void setObjectIdentityRetrievalStrategy(ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy)
void setPermissionFactory(PermissionFactory permissionFactory)
void setSidRetrievalStrategy(SidRetrievalStrategy sidRetrievalStrategy)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.access.PermissionEvaluator

Public Constructors

public AclPermissionEvaluator (AclService aclService)

Public Methods

public boolean hasPermission (Authentication authentication, Object domainObject, Object permission)

Determines whether the user has the given permission(s) on the domain object using the ACL configuration. If the domain object is null, returns false (this can always be overridden using a null check in the expression itself).

public boolean hasPermission (Authentication authentication, Serializable targetId, String targetType, Object permission)

Alternative method for evaluating a permission where only the identifier of the target object is available, rather than the target instance itself.

Parameters
authentication represents the user in question. Should not be null.
targetId the identifier for the object instance (usually a Long)
targetType a String representing the target's type (usually a Java classname). Not null.
permission a representation of the permission object as supplied by the expression system. Not null.
Returns
  • true if the permission is granted, false otherwise

public void setObjectIdentityGenerator (ObjectIdentityGenerator objectIdentityGenerator)

public void setObjectIdentityRetrievalStrategy (ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy)

public void setPermissionFactory (PermissionFactory permissionFactory)

public void setSidRetrievalStrategy (SidRetrievalStrategy sidRetrievalStrategy)