public class AclPermissionEvaluator extends Object implements PermissionEvaluator
AclEntryVoter
.Constructor and Description |
---|
AclPermissionEvaluator(AclService aclService) |
Modifier and Type | Method and Description |
---|---|
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) |
public AclPermissionEvaluator(AclService aclService)
public boolean hasPermission(Authentication authentication, Object domainObject, Object permission)
hasPermission
in interface PermissionEvaluator
authentication
- represents the user in question. Should not be null.domainObject
- the domain object for which permissions should be
checked. May be null in which case implementations should return false, as the null
condition can be checked explicitly in the expression.permission
- a representation of the permission object as supplied by the
expression system. Not null.public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission)
PermissionEvaluator
hasPermission
in interface PermissionEvaluator
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.public void setObjectIdentityRetrievalStrategy(ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy)
public void setObjectIdentityGenerator(ObjectIdentityGenerator objectIdentityGenerator)
public void setSidRetrievalStrategy(SidRetrievalStrategy sidRetrievalStrategy)
public void setPermissionFactory(PermissionFactory permissionFactory)