Interface ACLPersistenceStrategy

  • All Known Implementing Classes:
    JPAPersistenceStrategy

    public interface ACLPersistenceStrategy

    This interface defines the methods that must be implemented by classes that manage the persistence of ACLs. It is used by the ACLProvider to obtain the ACLs that are used in the instance-based authorization checks.

    Author:
    Stefan Guilhen
    • Method Detail

      • getACL

        ACL getACL​(Resource resource)

        Obtains a reference to the ACL associated to the given resource.

        Parameters:
        resource - the Resource for which the associated ACL is wanted.
        Returns:
        a reference to the ACL associated with the resource, or null if no ACL could be found.
      • getACLs

        Collection<ACL> getACLs()

        Obtains all ACLs that are managed by this ACLPersistenceStrategy.

        Returns:
        a Collection containing all ACLs retrieved by this strategy.
      • createACL

        ACL createACL​(Resource resource)

        Creates a new ACL and associates it to the given resource.

        Parameters:
        resource - the Resource for 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 ACL with the specified entries and associates it to the given resource.

        Parameters:
        resource - the Resource for which an ACL is to be created.
        entries - a Collection containing the entries that must be added to the ACL.
        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 - the ACL that needs to be updated.
        Returns:
        true if the ACL was updated; false otherwise.
      • removeACL

        boolean removeACL​(ACL acl)

        Removes the given ACL, breaking the existing association with the resource it relates to.

        Parameters:
        acl - a reference to the ACL that is to be removed.
        Returns:
        true if the ACL was removed; false otherwise.
      • removeACL

        boolean removeACL​(Resource resource)

        Removes the ACL associated with the specified resource.

        Parameters:
        resource - the Resource whose associated ACL is to be removed.
        Returns:
        true if the ACL was removed; false otherwise.