@Service @Transactional public class CustomAclServiceImpl extends Object implements CustomAclService
CustomAclService.AclObjectIdentityExt| Constructor and Description |
|---|
CustomAclServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupAcl()
Cleanup ACL: remove
AclEntry and AclObjectIdentity for
missing ACL-aware entities, remove obsolete AclClass. |
void |
createOrUpdatePermissions(AclAwareModel target)
Adds the creator permissions or updates permission inheritance.
|
void |
createOrUpdatePermissions(AclAwareModel target,
AclSid ownerSid)
Adds the creator permissions or updates permission inheritance.
|
AclSid |
ensureAuthoritySid(String authority)
Gets (and creates if missing) the sid for the specified authority.
|
AclObjectIdentity |
ensureObjectIdentity(long objectIdIdentity,
String className)
Ensure object identity.
|
List<AclEntry> |
getAclEntries(AclAwareModel entity)
Gets the acl entries.
|
List<AclEntry> |
getAclEntries(AclObjectIdentity objectIdentity)
Gets the acl entries.
|
AclSid |
getAuthoritySid(String authority)
Gets the sid for the specified authority.
|
org.springframework.security.acls.model.Permission[] |
getAvailablePermissions(String className)
Gets the available permissions.
|
AclObjectIdentity |
getObjectIdentity(AclAwareModel entity)
Gets the object identity of the entity.
|
AclObjectIdentity |
getObjectIdentity(long id)
Get object identity by internal id.
|
AclObjectIdentity |
getObjectIdentity(long id,
String className)
Gets the object identity for object of type className with specified id.
|
List<SidPermissions> |
getPermissions(AclAwareModel entity)
Gets the permissions.
|
List<SidPermissions> |
getPermissions(long id,
String className)
Gets the permissions.
|
AclSid |
getSid(Long id)
Get SID by ID.
|
Long |
getSidId(String sid)
Gets the sid id.
|
String |
getSidName(long id)
Gets the sid name.
|
List<AclSid> |
getSids(AclAwareModel entity)
Gets the sids.
|
List<AclSid> |
getSids(long id,
String className)
Gets the sids.
|
List<AclSid> |
listAuthoritySids()
List authority sids.
|
List<Long> |
listObjectIdentityIdsForSid(Class<? extends AclAwareModel> clazz,
AclSid sid,
org.springframework.security.acls.model.Permission permission)
List IDs of the specified class for the SID with specified permissions.
|
CustomAclService.AclObjectIdentityExt |
loadObjectIdentityExt(AclObjectIdentity objectIdentity)
Load object identity extended information.
|
void |
makePubliclyReadable(AclAwareModel entity,
boolean publiclyReadable)
Make entity publicly readable (or not).
|
void |
removeAclAwareModel(AclAwareModel target)
Remove ACL data for AclAwareModel: deletes
AclObjectIdentity and
associated AclEntry list. |
AclSid |
removeAuthoritySid(String authority)
Removes the sid of the specified authority.
|
AclObjectIdentity |
removePermissions(AclObjectIdentity objectIdentity,
AclSid sid)
Removes the permissions for SID on ACL OID.
|
void |
removePermissionsFor(AclSid sid)
Removes the all permissions of SID.
|
AclObjectIdentity |
setAclParent(AclAwareModel target,
AclAwareModel parent)
Set ACL parent object for inherited permissions.
|
AclObjectIdentity |
setPermissions(AclAwareModel entity,
AclSid sid,
Permissions permissions)
Update permissions.
|
AclObjectIdentity |
setPermissions(AclObjectIdentity objectIdentity,
AclSid sid,
Permissions permissions)
Update permissions.
|
AclObjectIdentity |
updateInheriting(long objectIdIdentity,
boolean entriesInheriting)
Updates inheriting status of object identity.
|
AclObjectIdentity |
updateParentObject(long objectIdIdentity,
long parentObjectId)
Updates parent object of object identity.
|
@Transactional(readOnly=true) public AclSid getSid(Long id)
CustomAclServicegetSid in interface CustomAclServiceid - -- ID of an AclSid entity@Transactional(readOnly=true)
@Cacheable(cacheNames="aclSidNames",
key="#id",
unless="#result == null")
public String getSidName(long id)
CustomAclServicegetSidName in interface CustomAclServicegetSidName in interface JsonSidConverter.SidProviderid - the id@Transactional(readOnly=true,
propagation=REQUIRES_NEW,
isolation=READ_UNCOMMITTED)
@Cacheable(cacheNames="aclSidNames",
key="#sid",
unless="#result == null")
public Long getSidId(String sid)
CustomAclServicegetSidId in interface CustomAclServicesid - the sidpublic AclSid getAuthoritySid(String authority)
CustomAclServicegetAuthoritySid in interface CustomAclServiceauthority - the authority (must start with "ROLE_")@Transactional(propagation=REQUIRED) public AclSid ensureAuthoritySid(String authority)
CustomAclServiceensureAuthoritySid in interface CustomAclServiceauthority - the authority (must start with "ROLE_")@Transactional(propagation=REQUIRED) public AclSid removeAuthoritySid(String authority)
CustomAclServiceremoveAuthoritySid in interface CustomAclServiceauthority - the authority name@Transactional(propagation=REQUIRED) public void createOrUpdatePermissions(AclAwareModel target, AclSid ownerSid)
CustomAclServicecreateOrUpdatePermissions in interface CustomAclServicetarget - the ACL entityownerSid - Owner@Transactional(propagation=REQUIRED) public void createOrUpdatePermissions(AclAwareModel target)
CustomAclServicecreateOrUpdatePermissions in interface CustomAclServicetarget - the target@PreAuthorize(value="hasRole(\'ADMINISTRATOR\')") public AclObjectIdentity updateInheriting(long objectIdIdentity, boolean entriesInheriting)
CustomAclServiceupdateInheriting in interface CustomAclServiceobjectIdIdentity - the id of object identityentriesInheriting - the inheriting status@PreAuthorize(value="hasRole(\'ADMINISTRATOR\')") public AclObjectIdentity setAclParent(AclAwareModel target, AclAwareModel parent)
CustomAclServicesetAclParent in interface CustomAclServicetarget - the target ACL object on which to change ACLparent - the parent ACL object@PreAuthorize(value="hasRole(\'ADMINISTRATOR\')") public AclObjectIdentity updateParentObject(long objectIdIdentity, long parentObjectId)
CustomAclServiceupdateParentObject in interface CustomAclServiceobjectIdIdentity - the id of object identityparentObjectId - the id of parent object identity@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
public void removeAclAwareModel(AclAwareModel target)
AclObjectIdentity and
associated AclEntry list. If target happens to be AclSid,
permissions granted to the SID are removed.removeAclAwareModel in interface CustomAclServicetarget - the target@Transactional(propagation=REQUIRED) public void removePermissionsFor(AclSid sid)
CustomAclServiceremovePermissionsFor in interface CustomAclServicesid - the sid@Transactional(readOnly=true) public CustomAclService.AclObjectIdentityExt loadObjectIdentityExt(AclObjectIdentity objectIdentity)
CustomAclServiceloadObjectIdentityExt in interface CustomAclServiceobjectIdentity - the object identity@Transactional(readOnly=true) @PostAuthorize(value="returnObject==null or hasRole(\'ADMINISTRATOR\') or hasPermission(#returnObject.objectIdIdentity, #returnObject.aclClass.aclClass, \'READ\')") public AclObjectIdentity getObjectIdentity(long id)
CustomAclServicegetObjectIdentity in interface CustomAclServiceid - AclObjectIdentity id@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#id, #className, \'ADMINISTRATION\')") public AclObjectIdentity getObjectIdentity(long id, String className)
CustomAclServicegetObjectIdentity in interface CustomAclServiceid - the idclassName - the clazz@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')") public AclObjectIdentity getObjectIdentity(AclAwareModel entity)
CustomAclServicegetObjectIdentity in interface CustomAclServiceentity - the entity@Transactional(readOnly=true) public org.springframework.security.acls.model.Permission[] getAvailablePermissions(String className)
CustomAclServicegetAvailablePermissions in interface CustomAclServiceclassName - the class name@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#id, #className, \'ADMINISTRATION\')") public List<SidPermissions> getPermissions(long id, String className)
CustomAclServicegetPermissions in interface CustomAclServiceid - the idclassName - the class name@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')") public List<SidPermissions> getPermissions(AclAwareModel entity)
CustomAclServicegetPermissions in interface CustomAclServiceentity - the entity@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
@PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')")
public AclObjectIdentity setPermissions(AclAwareModel entity,
AclSid sid,
Permissions permissions)
CustomAclServicesetPermissions in interface CustomAclServiceentity - the entitysid - the sidpermissions - the permissions@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
@PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#objectIdentity.objectIdIdentity, #objectIdentity.aclClass.aclClass, \'ADMINISTRATION\')")
public AclObjectIdentity setPermissions(AclObjectIdentity objectIdentity,
AclSid sid,
Permissions permissions)
CustomAclServicesetPermissions in interface CustomAclServiceobjectIdentity - the object identitysid - the sidpermissions - the permissions@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
public AclObjectIdentity removePermissions(AclObjectIdentity objectIdentity,
AclSid sid)
CustomAclServiceremovePermissions in interface CustomAclServiceobjectIdentity - the object identitysid - the acl sid@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#objectIdentity.objectIdIdentity, #objectIdentity.aclClass.aclClass, \'ADMINISTRATION\')") public List<AclEntry> getAclEntries(AclObjectIdentity objectIdentity)
CustomAclServicegetAclEntries in interface CustomAclServiceobjectIdentity - the object identity@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')") public List<AclEntry> getAclEntries(AclAwareModel entity)
CustomAclServicegetAclEntries in interface CustomAclServiceentity - the entity@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#id, #className, \'ADMINISTRATION\')") public List<AclSid> getSids(long id, String className)
CustomAclServicegetSids in interface CustomAclServiceid - the idclassName - the class name@Transactional(readOnly=true) @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')") public List<AclSid> getSids(AclAwareModel entity)
CustomAclServicegetSids in interface CustomAclServiceentity - the entity@Transactional(readOnly=true) public List<AclSid> listAuthoritySids()
CustomAclServicelistAuthoritySids in interface CustomAclServiceAclSid for authorities@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
public AclObjectIdentity ensureObjectIdentity(long objectIdIdentity,
String className)
CustomAclServiceensureObjectIdentity in interface CustomAclServiceobjectIdIdentity - the object id identityclassName - the class name@Transactional(readOnly=true) public List<Long> listObjectIdentityIdsForSid(Class<? extends AclAwareModel> clazz, AclSid sid, org.springframework.security.acls.model.Permission permission)
CustomAclServicelistObjectIdentityIdsForSid in interface CustomAclServiceclazz - the clazzsid - the sidpermission - the permission@Transactional(propagation=REQUIRED,
isolation=READ_UNCOMMITTED)
@PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#entity, \'ADMINISTRATION\')")
public void makePubliclyReadable(AclAwareModel entity,
boolean publiclyReadable)
CustomAclServicemakePubliclyReadable in interface CustomAclServiceentity - The entitypubliclyReadable - true or false?@Transactional public void cleanupAcl()
CustomAclServiceAclEntry and AclObjectIdentity for
missing ACL-aware entities, remove obsolete AclClass.cleanupAcl in interface CustomAclServiceCopyright © 2020 Global Crop Diversity Trust. All rights reserved.