@Slf4j class AclUtilService extends java.lang.Object
Utility service that hides a lot of the implementation details for working with ACLs.
| Type | Name and description |
|---|---|
java.lang.Object |
aclServiceDependency injection for aclService. |
ObjectIdentityRetrievalStrategyAndGenerator |
objectIdentityRetrievalStrategyDependency injection for objectIdentityRetrievalStrategy. |
PermissionEvaluator |
permissionEvaluatorDependency injection for permissionEvaluator. |
SidRetrievalStrategy |
sidRetrievalStrategyDependency injection for sidRetrievalStrategy. |
| Constructor and description |
|---|
AclUtilService() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addPermission(java.lang.Class<?> domainClass, java.io.Serializable id, java.lang.Object recipient, Permission permission)Grant a permission. |
|
void |
addPermission(java.lang.Object domainObject, java.lang.Object recipient, Permission permission)Grant a permission. |
|
void |
addPermission(ObjectIdentity oid, java.lang.Object recipient, Permission permission)Grant a permission. |
|
void |
changeOwner(java.lang.Object domainObject, java.lang.String newUsername)Update the owner of the domain class instance. |
|
protected Sid |
createSid(java.lang.Object recipient) |
|
void |
deleteAcl(java.lang.Object domainObject)Helper method to delete an ACL for a domain class. |
|
void |
deletePermission(java.lang.Object domainObject, java.lang.Object recipient, Permission permission)Removes a granted permission. |
|
void |
deletePermission(java.lang.Class<?> domainClass, long id, java.lang.Object recipient, Permission permission)Removes a granted permission. |
|
boolean |
hasPermission(Authentication authentication, java.lang.Object domainObject, Permission[] permissions)Check if the authentication has grants for the specified permission(s) on the domain class instance. |
|
boolean |
hasPermission(Authentication authentication, java.lang.Object domainObject, java.util.List<Permission> permissions)Check if the authentication has grants for the specified permission(s) on the domain class instance. |
|
Acl |
readAcl(java.lang.Object domainObject)Helper method to retrieve the ACL for a domain class instance. |
|
Acl |
readAcl(java.lang.Class<?> domainClass, java.lang.Object id)Helper method to retrieve the ACL for a domain class instance. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Dependency injection for aclService.
Dependency injection for objectIdentityRetrievalStrategy.
Dependency injection for permissionEvaluator.
Dependency injection for sidRetrievalStrategy.
Grant a permission. Used when you don't have the instance available.
domainClass - the domain classid - the instance idrecipient - the grantee; can be a username, role name, Sid, or Authenticationpermission - the permission to grantGrant a permission. Used when you have the instance available.
domainObject - the domain class instancerecipient - the grantee; can be a username, role name, Sid, or Authenticationpermission - the permission to grantGrant a permission.
oid - represents the domain objectrecipient - the grantee; can be a username, role name, Sid, or Authenticationpermission - the permission to grantUpdate the owner of the domain class instance.
domainObject - the domain class instancenewOwnerUsername - the new usernameHelper method to delete an ACL for a domain class.
domainObject - the domain class instanceRemoves a granted permission. Used when you have the instance available.
domainObject - the domain class instancerecipient - the grantee; can be a username, role name, Sid, or Authenticationpermission - the permission to removeRemoves a granted permission. Used when you don't have the instance available.
domainClass - the domain classid - the instance idrecipient - the grantee; can be a username, role name, Sid, or Authenticationpermission - the permission to removeCheck if the authentication has grants for the specified permission(s) on the domain class instance.
authentication - an authentication representing a user and rolesdomainObject - the domain class instancepermissions - one or more permissions to checktrue if grantedCheck if the authentication has grants for the specified permission(s) on the domain class instance.
authentication - an authentication representing a user and rolesdomainObject - the domain class instancepermissions - one or more permissions to checktrue if grantedHelper method to retrieve the ACL for a domain class instance.
domainObject - the domain class instancenull)