com.netscape.certsrv.acls
Class ACL

java.lang.Object
  extended by com.netscape.certsrv.acls.ACL
All Implemented Interfaces:
IACL, java.io.Serializable

public class ACL
extends java.lang.Object
implements IACL, java.io.Serializable

A class represents an access control list (ACL). An ACL is associated with an protected resources. The policy enforcer can verify the ACLs with the current context to see if the corresponding resource is accessible.

An ACL may contain one or more ACLEntry. However, in case of multiple ACLEntry, a subject must pass ALL of the ACLEntry evaluation for permission to be granted

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
Serialized Form

Field Summary
protected  java.lang.String mDescription
           
protected  java.util.Vector mEntries
           
protected  java.lang.String mName
           
protected  java.lang.String mResourceACLs
           
protected  java.util.Vector mRights
           
 
Constructor Summary
ACL()
          Class constructor.
ACL(java.lang.String name, java.util.Vector rights, java.lang.String resourceACLs)
          Class constructor.
 
Method Summary
 void addEntry(ACLEntry entry)
          Adds an ACL entry to this list.
 void addRight(java.lang.String right)
          Adds an rights entry to this list.
 boolean checkRight(java.lang.String permission)
          Tells if the permission is one of the defined "rights"
 java.util.Enumeration entries()
          Returns ACL entries.
 java.lang.String getDescription()
          Retrieves the description of the resource governed by this access control.
 java.lang.String getName()
          Retrieves the name of the resource governed by this access control.
 java.lang.String getResourceACLs()
          Retrieves the exact string of the resourceACLs
 java.util.Enumeration rights()
          Returns rights entries.
 void setDescription(java.lang.String description)
          Sets the description of the resource governed by this access control.
 void setName(java.lang.String name)
          Sets the name of the resource governed by this access control.
 java.lang.String toString()
          Returns the string reprsentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mEntries

protected java.util.Vector mEntries

mRights

protected java.util.Vector mRights

mResourceACLs

protected java.lang.String mResourceACLs

mName

protected java.lang.String mName

mDescription

protected java.lang.String mDescription
Constructor Detail

ACL

public ACL()
Class constructor.


ACL

public ACL(java.lang.String name,
           java.util.Vector rights,
           java.lang.String resourceACLs)
Class constructor. Constructs an access control list associated with a resource name

Parameters:
name - resource name
rights - applicable rights defined for this resource
resourceACLs - the entire ACL specification. For example: "certServer.log.configuration:read,modify: allow (read,modify) group=\"Administrators\": Allow administrators to read and modify log configuration"
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the resource governed by this access control.

Parameters:
name - name of the resource

getName

public java.lang.String getName()
Retrieves the name of the resource governed by this access control.

Specified by:
getName in interface IACL
Returns:
name of the resource

getResourceACLs

public java.lang.String getResourceACLs()
Retrieves the exact string of the resourceACLs

Returns:
resource's acl

setDescription

public void setDescription(java.lang.String description)
Sets the description of the resource governed by this access control.

Parameters:
description - Description of the protected resource

getDescription

public java.lang.String getDescription()
Retrieves the description of the resource governed by this access control.

Specified by:
getDescription in interface IACL
Returns:
Description of the protected resource

addEntry

public void addEntry(ACLEntry entry)
Adds an ACL entry to this list.

Parameters:
entry - the ACLEntry to be added to this resource

entries

public java.util.Enumeration entries()
Returns ACL entries.

Specified by:
entries in interface IACL
Returns:
enumeration for the ACLEntry vector

toString

public java.lang.String toString()
Returns the string reprsentation.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the ACL entries in the following format: [,,...]

addRight

public void addRight(java.lang.String right)
Adds an rights entry to this list.

Parameters:
right - The right to be added for this ACL

checkRight

public boolean checkRight(java.lang.String permission)
Tells if the permission is one of the defined "rights"

Specified by:
checkRight in interface IACL
Parameters:
permission - permission to be checked
Returns:
true if it's one of the "rights"; false otherwise

rights

public java.util.Enumeration rights()
Returns rights entries.

Specified by:
rights in interface IACL
Returns:
enumeration of rights defined for this ACL