Package org.apache.wiki.auth.acl
Class AclEntryImpl
- java.lang.Object
-
- org.apache.wiki.auth.acl.AclEntryImpl
-
public class AclEntryImpl extends java.lang.Object implements AclEntry, java.io.Serializable
Implementation of a JSPWiki AclEntry.- Since:
- 2.3
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AclEntryImpl()Constructs a new AclEntryImpl instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddPermission(java.security.Permission permission)Adds the specified permission to this ACL entry.booleancheckPermission(java.security.Permission permission)Checks if the specified permission is part of the permission set in this entry.java.security.PrincipalgetPrincipal()Returns the principal for which permissions are granted by this ACL entry.java.util.Enumeration<java.security.Permission>permissions()Returns an enumeration of the permissions in this ACL entry.booleanremovePermission(java.security.Permission permission)Removes the specified permission from this ACL entry.booleansetPrincipal(java.security.Principal user)Specifies the principal for which permissions are granted or denied by this ACL entry.java.lang.StringtoString()Returns a string representation of the contents of this ACL entry.
-
-
-
Constructor Detail
-
AclEntryImpl
public AclEntryImpl()
Constructs a new AclEntryImpl instance.
-
-
Method Detail
-
addPermission
public boolean addPermission(java.security.Permission permission)
Adds the specified permission to this ACL entry. The permission must be of typePagePermission. Note: An entry can have multiple permissions.- Specified by:
addPermissionin interfaceAclEntry- Parameters:
permission- the permission to be associated with the principal in this entry- Returns:
trueif the permission was added,falseif the permission was already part of this entry's permission set, andfalseif the permission is not of type PagePermission
-
checkPermission
public boolean checkPermission(java.security.Permission permission)
Checks if the specified permission is part of the permission set in this entry.- Specified by:
checkPermissionin interfaceAclEntry- Parameters:
permission- the permission to be checked for.- Returns:
- true if the permission is part of the permission set in this entry, false otherwise.
-
getPrincipal
public java.security.Principal getPrincipal()
Returns the principal for which permissions are granted by this ACL entry. Returns null if there is no principal set for this entry yet.- Specified by:
getPrincipalin interfaceAclEntry- Returns:
- the principal associated with this entry.
-
permissions
public java.util.Enumeration<java.security.Permission> permissions()
Returns an enumeration of the permissions in this ACL entry.- Specified by:
permissionsin interfaceAclEntry- Returns:
- an enumeration of the permissions
-
removePermission
public boolean removePermission(java.security.Permission permission)
Removes the specified permission from this ACL entry.- Specified by:
removePermissionin interfaceAclEntry- Parameters:
permission- the permission to be removed from this entry.- Returns:
- true if the permission is removed, false if the permission was not part of this entry's permission set.
-
setPrincipal
public boolean setPrincipal(java.security.Principal user)
Specifies the principal for which permissions are granted or denied by this ACL entry. If a principal was already set for this ACL entry, false is returned, otherwise true is returned.- Specified by:
setPrincipalin interfaceAclEntry- Parameters:
user- the principal to be set for this entry- Returns:
- true if the principal is set, false if there was already a principal set for this entry
-
toString
public java.lang.String toString()
Returns a string representation of the contents of this ACL entry.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the contents.
-
-