Class HibernateAclImpl
java.lang.Object
com.atlassian.bamboo.security.acegi.acls.HibernateAclImpl
- All Implemented Interfaces:
HibernateAcl,Serializable,org.acegisecurity.acls.Acl,org.acegisecurity.acls.AuditableAcl,org.acegisecurity.acls.MutableAcl,org.acegisecurity.acls.OwnershipAcl
@Entity
public class HibernateAclImpl
extends Object
implements org.acegisecurity.acls.Acl, org.acegisecurity.acls.MutableAcl, org.acegisecurity.acls.AuditableAcl, org.acegisecurity.acls.OwnershipAcl, HibernateAcl
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNo-argument constructor for use by reflection-based persistence tools along with field-level access.HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, @Nullable org.acegisecurity.acls.Acl parentAcl, boolean entriesInheriting, org.acegisecurity.acls.sid.Sid owner) Instantiation of type properties - to be used when creating viaMutableAclService.createAcl(ObjectIdentity)HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, Serializable id, org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy) Minimal constructor, which should be usedMutableAclService.createAcl(ObjectIdentity).HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, Serializable id, org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy, @Nullable org.acegisecurity.acls.Acl parentAcl, @Nullable org.acegisecurity.acls.sid.Sid[] loadedSids, boolean entriesInheriting, org.acegisecurity.acls.sid.Sid owner) Full constructor, which should be used by persistence tools that do not provide field-level access features. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAce(Serializable aceId) booleanList<org.acegisecurity.acls.AccessControlEntry>getAces()org.acegisecurity.acls.AccessControlEntry[]getId()org.acegisecurity.acls.objectidentity.ObjectIdentityorg.acegisecurity.acls.sid.SidgetOwner()@Nullable org.acegisecurity.acls.AclinthashCode()voidinsertAce(@Nullable Serializable afterAceId, org.acegisecurity.acls.Permission permission, org.acegisecurity.acls.sid.Sid sid, boolean granting) booleanbooleanisGranted(org.acegisecurity.acls.Permission[] permission, org.acegisecurity.acls.sid.Sid[] sids, boolean administrativeMode) Determines authorization.booleanisSidLoaded(org.acegisecurity.acls.sid.Sid[] sids) voidsetAclAuthorizationStrategy(org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy) voidsetEntriesInheriting(boolean entriesInheriting) voidsetId(Serializable id) voidsetObjectIdentity(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity) voidsetOwner(org.acegisecurity.acls.sid.Sid newOwner) voidsetParent(org.acegisecurity.acls.Acl newParent) voidsetParent(org.acegisecurity.acls.MutableAcl newParent) voidsetParentAcl(org.acegisecurity.acls.Acl parentAcl) toString()voidupdateAce(Serializable aceId, org.acegisecurity.acls.Permission permission) voidupdateAuditing(Serializable aceId, boolean auditSuccess, boolean auditFailure)
-
Constructor Details
-
HibernateAclImpl
public HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, Serializable id, org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy) Minimal constructor, which should be usedMutableAclService.createAcl(ObjectIdentity).- Parameters:
objectIdentity- the object identity this ACL relates to (required)id- the primary key assigned to this ACL (required)aclAuthorizationStrategy- authorization strategy (required)
-
HibernateAclImpl
public HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, Serializable id, org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy, @Nullable @Nullable org.acegisecurity.acls.Acl parentAcl, @Nullable @Nullable org.acegisecurity.acls.sid.Sid[] loadedSids, boolean entriesInheriting, org.acegisecurity.acls.sid.Sid owner) Full constructor, which should be used by persistence tools that do not provide field-level access features.- Parameters:
objectIdentity- the object identity this ACL relates to (required)id- the primary key assigned to this ACL (required)aclAuthorizationStrategy- authorization strategy (required)parentAcl- the parent (may benull)loadedSids- the loaded SIDs if only a subset were loaded (may benull)entriesInheriting- if ACEs from the parent should inherit into this ACLowner- the owner (required)
-
HibernateAclImpl
public HibernateAclImpl()No-argument constructor for use by reflection-based persistence tools along with field-level access. -
HibernateAclImpl
public HibernateAclImpl(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, @Nullable @Nullable org.acegisecurity.acls.Acl parentAcl, boolean entriesInheriting, org.acegisecurity.acls.sid.Sid owner) Instantiation of type properties - to be used when creating viaMutableAclService.createAcl(ObjectIdentity)- Parameters:
parentAcl-objectIdentity-owner-entriesInheriting-
-
-
Method Details
-
deleteAce
- Specified by:
deleteAcein interfaceorg.acegisecurity.acls.MutableAcl- Throws:
org.acegisecurity.acls.NotFoundException
-
getEntries
public org.acegisecurity.acls.AccessControlEntry[] getEntries()- Specified by:
getEntriesin interfaceorg.acegisecurity.acls.Acl- Specified by:
getEntriesin interfaceorg.acegisecurity.acls.MutableAcl
-
getId
- Specified by:
getIdin interfaceorg.acegisecurity.acls.MutableAcl
-
getObjectIdentity
public org.acegisecurity.acls.objectidentity.ObjectIdentity getObjectIdentity()- Specified by:
getObjectIdentityin interfaceorg.acegisecurity.acls.Acl
-
getOwner
public org.acegisecurity.acls.sid.Sid getOwner()- Specified by:
getOwnerin interfaceorg.acegisecurity.acls.Acl
-
getParentAcl
@Nullable public @Nullable org.acegisecurity.acls.Acl getParentAcl()- Specified by:
getParentAclin interfaceorg.acegisecurity.acls.Acl
-
insertAce
public void insertAce(@Nullable @Nullable Serializable afterAceId, org.acegisecurity.acls.Permission permission, org.acegisecurity.acls.sid.Sid sid, boolean granting) throws org.acegisecurity.acls.NotFoundException - Specified by:
insertAcein interfaceorg.acegisecurity.acls.MutableAcl- Throws:
org.acegisecurity.acls.NotFoundException
-
isEntriesInheriting
public boolean isEntriesInheriting()- Specified by:
isEntriesInheritingin interfaceorg.acegisecurity.acls.Acl
-
isGranted
public boolean isGranted(org.acegisecurity.acls.Permission[] permission, org.acegisecurity.acls.sid.Sid[] sids, boolean administrativeMode) throws org.acegisecurity.acls.NotFoundException, org.acegisecurity.acls.UnloadedSidException Determines authorization. The order of thepermissionandsidarguments is extremely important! The method will iterate through each of thepermissions in the order specified. For each iteration, all of thesids will be considered, again in the order they are presented. A search will then be performed for the firstAccessControlEntryobject that directly matches thatpermission:sidcombination. When the first full match is found (ie an ACE that has the SID currently being searched for and the exact permission bit mask being search for), the grant or deny flag for that ACE will prevail. If the ACE specifies to grant access, the method will returntrue. If the ACE specifies to deny access, the loop will stop and the nextpermissioniteration will be performed. If each permission indicates to deny access, the first deny ACE found will be considered the reason for the failure (as it was the first match found, and is therefore the one most logically requiring changes - although not always). If absolutely no matching ACE was found at all for any permission, the parent ACL will be tried (provided that there is a parent andisEntriesInheriting()istrue. The parent ACL will also scan its parent and so on. If ultimately no matching ACE is found, aNotFoundExceptionwill be thrown and the caller will need to decide how to handle the permission check. Similarly, if any of the SID arguments presented to the method were not loaded by the ACL,UnloadedSidExceptionwill be thrown.- Specified by:
isGrantedin interfaceorg.acegisecurity.acls.Acl- Parameters:
permission- the exact permissions to scan for (order is important)sids- the exact SIDs to scan for (order is important)administrativeMode- iftruedenotes the query is for administrative purposes and no auditing will be undertaken- Returns:
trueif one of the permissions has been granted,falseif one of the permissions has been specifically revoked- Throws:
org.acegisecurity.acls.NotFoundException- if an exact ACE for one of the permission bit masks and SID combination could not be foundorg.acegisecurity.acls.UnloadedSidException- if the passed SIDs are unknown to this ACL because the ACL was only loaded for a subset of SIDs
-
isSidLoaded
public boolean isSidLoaded(org.acegisecurity.acls.sid.Sid[] sids) - Specified by:
isSidLoadedin interfaceorg.acegisecurity.acls.Acl
-
setEntriesInheriting
public void setEntriesInheriting(boolean entriesInheriting) - Specified by:
setEntriesInheritingin interfaceorg.acegisecurity.acls.MutableAcl
-
setOwner
public void setOwner(org.acegisecurity.acls.sid.Sid newOwner) - Specified by:
setOwnerin interfaceorg.acegisecurity.acls.OwnershipAcl
-
setParent
public void setParent(org.acegisecurity.acls.MutableAcl newParent) -
toString
-
updateAce
public void updateAce(Serializable aceId, org.acegisecurity.acls.Permission permission) throws org.acegisecurity.acls.NotFoundException - Specified by:
updateAcein interfaceorg.acegisecurity.acls.MutableAcl- Throws:
org.acegisecurity.acls.NotFoundException
-
updateAuditing
- Specified by:
updateAuditingin interfaceorg.acegisecurity.acls.AuditableAcl
-
hashCode
public int hashCode() -
equals
-
setParentAcl
public void setParentAcl(org.acegisecurity.acls.Acl parentAcl) -
setParent
public void setParent(org.acegisecurity.acls.Acl newParent) - Specified by:
setParentin interfaceorg.acegisecurity.acls.MutableAcl
-
setAclAuthorizationStrategy
public void setAclAuthorizationStrategy(org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy) -
getAces
-
setObjectIdentity
public void setObjectIdentity(org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity) - Specified by:
setObjectIdentityin interfaceHibernateAcl
-
setId
-