org.apache.wiki.auth.acl
Class AclEntryImpl

java.lang.Object
  extended by org.apache.wiki.auth.acl.AclEntryImpl
All Implemented Interfaces:
Serializable, AclEntry

public class AclEntryImpl
extends Object
implements AclEntry, Serializable

Implementation of a JSPWiki AclEntry.

Since:
2.3
See Also:
Serialized Form

Constructor Summary
AclEntryImpl()
          Constructs a new AclEntryImpl instance.
 
Method Summary
 boolean addPermission(Permission permission)
          Adds the specified permission to this ACL entry.
 boolean checkPermission(Permission permission)
          Checks if the specified permission is part of the permission set in this entry.
 Principal getPrincipal()
          Returns the principal for which permissions are granted by this ACL entry.
 Enumeration<Permission> permissions()
          Returns an enumeration of the permissions in this ACL entry.
 boolean removePermission(Permission permission)
          Removes the specified permission from this ACL entry.
 boolean setPrincipal(Principal user)
          Specifies the principal for which permissions are granted or denied by this ACL entry.
 String toString()
          Returns a string representation of the contents of this ACL entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AclEntryImpl

public AclEntryImpl()
Constructs a new AclEntryImpl instance.

Method Detail

addPermission

public boolean addPermission(Permission permission)
Adds the specified permission to this ACL entry. The permission must be of type PagePermission. Note: An entry can have multiple permissions.

Specified by:
addPermission in interface AclEntry
Parameters:
permission - the permission to be associated with the principal in this entry
Returns:
true if the permission was added, false if the permission was already part of this entry's permission set, and false if the permission is not of type PagePermission

checkPermission

public boolean checkPermission(Permission permission)
Checks if the specified permission is part of the permission set in this entry.

Specified by:
checkPermission in interface AclEntry
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 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:
getPrincipal in interface AclEntry
Returns:
the principal associated with this entry.

permissions

public Enumeration<Permission> permissions()
Returns an enumeration of the permissions in this ACL entry.

Specified by:
permissions in interface AclEntry
Returns:
an enumeration of the permissions

removePermission

public boolean removePermission(Permission permission)
Removes the specified permission from this ACL entry.

Specified by:
removePermission in interface AclEntry
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(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:
setPrincipal in interface AclEntry
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 String toString()
Returns a string representation of the contents of this ACL entry.

Specified by:
toString in interface AclEntry
Overrides:
toString in class Object
Returns:
a string representation of the contents.


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.