Class AclImpl

  • All Implemented Interfaces:
    java.io.Serializable, Acl, Acl

    public class AclImpl
    extends java.lang.Object
    implements Acl, java.io.Serializable
    JSPWiki implementation of an Access Control List.
    Since:
    2.3
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AclImpl()
      Constructs a new AclImpl instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration<AclEntry> aclEntries()
      Returns an enumeration of the entries in this ACL.
      boolean addEntry​(AclEntry entry)
      Adds an ACL entry to this ACL.
      java.security.Principal[] findPrincipals​(java.security.Permission permission)
      Returns all Principal objects assigned a given Permission in the access control list.
      AclEntry getAclEntry​(java.security.Principal principal)
      Returns an AclEntry for a supplied Principal, or null if the Principal does not have a matching AclEntry.
      boolean isEmpty()
      Returns true, if this Acl is empty.
      boolean removeEntry​(AclEntry entry)
      Removes an ACL entry from this ACL.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AclImpl

        public AclImpl()
        Constructs a new AclImpl instance.
    • Method Detail

      • findPrincipals

        public java.security.Principal[] findPrincipals​(java.security.Permission permission)
        Returns all Principal objects assigned a given Permission in the access control list. The Principals returned are those that have been granted either the supplied permission, or a permission implied by the supplied permission. Principals are not "expanded" if they are a role or group.
        Specified by:
        findPrincipals in interface Acl
        Parameters:
        permission - the permission to search for
        Returns:
        an array of Principals possessing the permission
      • addEntry

        public boolean addEntry​(AclEntry entry)
        Adds an ACL entry to this ACL. An entry associates a principal (e.g., an individual or a group) with a set of permissions. Each principal can have at most one positive ACL entry, specifying permissions to be granted to the principal. If there is already an ACL entry already in the ACL, false is returned.
        Specified by:
        addEntry in interface Acl
        Parameters:
        entry - - the ACL entry to be added to this ACL
        Returns:
        true on success, false if an entry of the same type (positive or negative) for the same principal is already present in this ACL
      • removeEntry

        public boolean removeEntry​(AclEntry entry)
        Removes an ACL entry from this ACL.
        Specified by:
        removeEntry in interface Acl
        Parameters:
        entry - the ACL entry to be removed from this ACL
        Returns:
        true on success, false if the entry is not part of this ACL
      • aclEntries

        public java.util.Enumeration<AclEntryaclEntries()
        Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type AclEntry.
        Specified by:
        aclEntries in interface Acl
        Returns:
        an enumeration of the entries in this ACL.
      • getAclEntry

        public AclEntry getAclEntry​(java.security.Principal principal)
        Returns an AclEntry for a supplied Principal, or null if the Principal does not have a matching AclEntry.
        Specified by:
        getAclEntry in interface Acl
        Parameters:
        principal - the principal to search for
        Returns:
        the AclEntry associated with the principal, or null
      • isEmpty

        public boolean isEmpty()
        Returns true, if this Acl is empty.
        Specified by:
        isEmpty in interface Acl
        Returns:
        the result
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object