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.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, ornull
if the Principal does not have a matching AclEntry.boolean
isEmpty()
Returnstrue
, 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
-
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 Princiapls 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 interfaceAcl
- Parameters:
permission
- the permission to search for- Returns:
- an array of Principals posessing 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:
removeEntry
in 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:
aclEntries
in 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, ornull
if the Principal does not have a matching AclEntry.- Specified by:
getAclEntry
in 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:
toString
in classjava.lang.Object
-
-