Interface java.security.acl.Acl
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.security.acl.Acl

public interface Acl
extends Object
extends Owner
Interface representing an Access Control List (ACL)

Method Index

 o addEntry(Principal, AclEntry)
Adds an ACL entry to this ACL.
 o checkPermission(Principal, Permission)
This method checks whether or not the specified principal has the required permission.
 o entries()
returns an enumeration of the entries in this ACL.
 o getName()
Returns the name of the ACL.
 o getPermissions(Principal)
This method returns the set of allowed permissions for the specified principal.
 o removeEntry(Principal, AclEntry)
Removes an ACL entry from this ACL.
 o setName(Principal, String)
Sets the name of the ACL.
 o toString()
return a stringified version of the ACL.

Methods

 o setName
  public abstract void setName(Principal caller,
                               String name) throws PrincipalNotOwnerException
Sets the name of the ACL.
Parameters:
caller - the principal who is invoking this method.
name - the name of the ACL.
Throws: PrincipalNotOwnerException
if the caller principal is not on the owners list of the Acl.
 o getName
  public abstract String getName()
Returns the name of the ACL.
Returns:
the name of the ACL.
 o addEntry
  public abstract boolean addEntry(Principal caller,
                                   AclEntry entry) throws PrincipalNotOwnerException
Adds an ACL entry to this ACL. An entry associates a group or a principal with a set of permissions. Each user or group can have one positive ACL entry and one negative ACL entry. If there is one of the type (negative or positive) already in the table, a false value is returned. The caller principal must be a part of the owners list of the ACL in order to invoke this method.
Parameters:
caller - the principal who is invoking this method.
entry - the ACL entry that must be added to the ACL.
Returns:
true on success, false if the entry is already present.
Throws: PrincipalNotOwnerException
if the caller principal is not on the owners list of the Acl.
 o removeEntry
  public abstract boolean removeEntry(Principal caller,
                                      AclEntry entry) throws PrincipalNotOwnerException
Removes an ACL entry from this ACL. The caller principal must be a part of the owners list of the ACL in order to invoke this method.
Parameters:
caller - the principal who is invoking this method.
entry - the ACL entry that must be removed from the ACL.
Returns:
true on success, false if the entry is not part of the ACL.
Throws: PrincipalNotOwnerException
if the caller principal is not the owners list of the Acl.
 o getPermissions
  public abstract Enumeration getPermissions(Principal user)
This method returns the set of allowed permissions for the specified principal. The entry is got by subtracting the negative permissions for the principal from the positive permissions for the principal. If the principal belongs to a group, then the group's ACL permissions are also considered with the following rule: the ACL for the principal takes precedence over the group's ACL. The group considered is the first member of
Parameters:
user - the principal for which the ACL entry is returned.
Returns:
The resulting permission set that the principal is allowed. This is got by subtracting the principal's negative permissions from the principal's positive permissions. If the principal has no positive or negative permission set, the first group that has the principal as a member is considered.
 o entries
  public abstract Enumeration entries()
returns an enumeration of the entries in this ACL.
 o checkPermission
  public abstract boolean checkPermission(Principal principal,
                                          Permission permission)
This method checks whether or not the specified principal has the required permission. If permission is denied permission false is returned, a true value is returned otherwise. This method does not authenticate the principal. It presumes that the principal is a valid authenticated principal.
Parameters:
principal - the name of the authenticated principal
permission - the permission that the principal must have.
Returns:
true of the principal has the permission desired, false otherwise.
 o toString
  public abstract String toString()
return a stringified version of the ACL.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index