Package org.apache.wiki.auth.acl
Class AclImpl
- java.lang.Object
-
- org.apache.wiki.auth.acl.AclImpl
-
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.booleanaddEntry(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.AclEntrygetAclEntry(java.security.Principal principal)Returns an AclEntry for a supplied Principal, ornullif the Principal does not have a matching AclEntry.booleanisEmpty()Returnstrue, if this Acl is empty.booleanremoveEntry(AclEntry entry)Removes an ACL entry from this ACL.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wiki.auth.acl.Acl
addEntry, entries, getEntry, removeEntry
-
-
-
-
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:
findPrincipalsin interfaceAcl- 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.
-
removeEntry
public boolean removeEntry(AclEntry entry)
Removes an ACL entry from this ACL.- Specified by:
removeEntryin interfaceAcl- 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<AclEntry> aclEntries()
Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type AclEntry.- Specified by:
aclEntriesin interfaceAcl- Returns:
- an enumeration of the entries in this ACL.
-
getAclEntry
public AclEntry getAclEntry(java.security.Principal principal)
Returns an AclEntry for a supplied Principal, ornullif the Principal does not have a matching AclEntry.- Specified by:
getAclEntryin interfaceAcl- Parameters:
principal- the principal to search for- Returns:
- the AclEntry associated with the principal, or
null
-
isEmpty
public boolean isEmpty()
Returnstrue, if this Acl is empty.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-