Interface ACLPersistenceStrategy
-
- All Known Implementing Classes:
JPAPersistenceStrategy
public interface ACLPersistenceStrategyThis interface defines the methods that must be implemented by classes that manage the persistence of
ACLs. It is used by theACLProviderto obtain theACLs that are used in the instance-based authorization checks.- Author:
- Stefan Guilhen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ACLcreateACL(Resource resource)Creates a newACLand associates it to the given resource.ACLcreateACL(Resource resource, Collection<ACLEntry> entries)Creates a newACLwith the specified entries and associates it to the given resource.ACLgetACL(Resource resource)Obtains a reference to theACLassociated to the given resource.Collection<ACL>getACLs()Obtains allACLs that are managed by thisACLPersistenceStrategy.booleanremoveACL(ACL acl)Removes the givenACL, breaking the existing association with the resource it relates to.booleanremoveACL(Resource resource)Removes theACLassociated with the specified resource.booleanupdateACL(ACL acl)Updates the givenACL.
-
-
-
Method Detail
-
getACL
ACL getACL(Resource resource)
Obtains a reference to the
ACLassociated to the given resource.- Parameters:
resource- theResourcefor which the associated ACL is wanted.- Returns:
- a reference to the
ACLassociated with the resource, or null if no ACL could be found.
-
getACLs
Collection<ACL> getACLs()
Obtains all
ACLs that are managed by thisACLPersistenceStrategy.- Returns:
- a
Collectioncontaining allACLs retrieved by this strategy.
-
createACL
ACL createACL(Resource resource)
Creates a new
ACLand associates it to the given resource.- Parameters:
resource- theResourcefor which an ACL is to be created.- Returns:
- a reference to the created
ACL.
-
createACL
ACL createACL(Resource resource, Collection<ACLEntry> entries)
Creates a new
ACLwith the specified entries and associates it to the given resource.- Parameters:
resource- theResourcefor which an ACL is to be created.entries- aCollectioncontaining the entries that must be added to theACL.- Returns:
- a reference to the created
ACL.
-
updateACL
boolean updateACL(ACL acl)
Updates the given
ACL. This usually means updating the repository where the ACLs are stored.- Parameters:
acl- theACLthat needs to be updated.- Returns:
trueif the ACL was updated;falseotherwise.
-
removeACL
boolean removeACL(ACL acl)
Removes the given
ACL, breaking the existing association with the resource it relates to.- Parameters:
acl- a reference to theACLthat is to be removed.- Returns:
trueif the ACL was removed;falseotherwise.
-
removeACL
boolean removeACL(Resource resource)
Removes the
ACLassociated with the specified resource.- Parameters:
resource- theResourcewhose associated ACL is to be removed.- Returns:
trueif the ACL was removed;falseotherwise.
-
-