Package com.netscape.cms.authorization
Class ACL
- java.lang.Object
-
- com.netscape.cms.authorization.ACL
-
- All Implemented Interfaces:
com.netscape.certsrv.acls.IACL
,java.io.Serializable
public class ACL extends java.lang.Object implements com.netscape.certsrv.acls.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 moreACLEntry
. However, in case of multipleACLEntry
, a subject must pass ALL of theACLEntry
evaluation for permission to be granted- Version:
- $Revision$, $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
description
protected java.util.Vector<com.netscape.certsrv.acls.ACLEntry>
entries
protected java.lang.String
name
protected java.util.TreeSet<java.lang.String>
resourceACLs
protected java.util.TreeSet<java.lang.String>
rights
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkRight(java.lang.String permission)
Tells if the permission is one of the defined "rights"java.util.Enumeration<com.netscape.certsrv.acls.ACLEntry>
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.Iterable<java.lang.String>
getResourceACLs()
Retrieve an iterable of strings that were used to produce this ACL.void
merge(ACL other)
Merge the rules of the other ACL into this one.static ACL
parseACL(java.lang.String resACLs)
Parse ACL resource attributesjava.util.Enumeration<java.lang.String>
rights()
Returns rights entries.java.lang.String
toString()
Returns the string reprsentation.
-
-
-
Field Detail
-
entries
protected java.util.Vector<com.netscape.certsrv.acls.ACLEntry> entries
-
rights
protected java.util.TreeSet<java.lang.String> rights
-
name
protected java.lang.String name
-
description
protected java.lang.String description
-
resourceACLs
protected java.util.TreeSet<java.lang.String> resourceACLs
-
-
Method Detail
-
merge
public void merge(ACL other)
Merge the rules of the other ACL into this one.- Throws:
java.lang.IllegalArgumentException
- if the ACLs do not have the same name.
-
getName
public java.lang.String getName()
Retrieves the name of the resource governed by this access control.- Specified by:
getName
in interfacecom.netscape.certsrv.acls.IACL
- Returns:
- name of the resource
-
getResourceACLs
public java.lang.Iterable<java.lang.String> getResourceACLs()
Retrieve an iterable of strings that were used to produce this ACL.- Returns:
- Iterable of formatted ACLs
-
getDescription
public java.lang.String getDescription()
Retrieves the description of the resource governed by this access control.- Specified by:
getDescription
in interfacecom.netscape.certsrv.acls.IACL
- Returns:
- Description of the protected resource
-
entries
public java.util.Enumeration<com.netscape.certsrv.acls.ACLEntry> entries()
Returns ACL entries.- Specified by:
entries
in interfacecom.netscape.certsrv.acls.IACL
- Returns:
- enumeration for the
ACLEntry
vector
-
toString
public java.lang.String toString()
Returns the string reprsentation.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string representation of the ACL entries in the
following format:
[ , ,... ]
-
checkRight
public boolean checkRight(java.lang.String permission)
Tells if the permission is one of the defined "rights"- Specified by:
checkRight
in interfacecom.netscape.certsrv.acls.IACL
- Parameters:
permission
- permission to be checked- Returns:
- true if it's one of the "rights"; false otherwise
-
rights
public java.util.Enumeration<java.lang.String> rights()
Returns rights entries.- Specified by:
rights
in interfacecom.netscape.certsrv.acls.IACL
- Returns:
- enumeration of rights defined for this ACL
-
parseACL
public static ACL parseACL(java.lang.String resACLs) throws com.netscape.certsrv.acls.EACLsException
Parse ACL resource attributes- Parameters:
resACLs
- same format as the resourceACLs attribute:: : ( ) - Returns:
- an ACL instance built from the parsed resACLs
- Throws:
com.netscape.certsrv.acls.EACLsException
- ACL related parsing errors for resACLs
-
-