|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.tspaces.ac.TsAcl
This class implements the java.security.Acl Interface. An Access Control List is a data structure used to guard access to resources.
An ACL can be thought of as a data structure with multiple ACL entries. Each ACL entry, of interface type AclEntry, contains a set of permissions associated with a particular principal. (A principal represents an entity such as an individual user or a group). Additionally, each ACL entry is specified as being either positive or negative. If positive, the permissions are to be granted to the associated principal. If negative, the permissions are to be denied.
Internally tsAcl is contains the following instance variables.
String _Name Name used to refer to this Acl Vector _Owners Vector of owners of this ACL Vector _AclEntries Vector of ACLEntry items.
TupleSpace,
SubclassableTuple,
Acl,
AclEntry, Serialized Form| Constructor Summary | |
TsAcl(java.lang.String name,
java.security.Principal owner)
Constructor with name and Owner specified. |
|
| Method Summary | |
boolean |
addEntry(java.security.Principal caller,
java.security.acl.AclEntry entry)
Adds an ACL entry to this ACL. |
boolean |
addOwner(java.security.Principal caller,
java.security.Principal owner)
Adds an owner. |
boolean |
checkPermission(java.security.Principal user,
java.security.acl.Permission permission)
Checks whether or not the specified principal has the specified permission. |
java.lang.String |
debug()
Returns a string representation of the ACL contents for debug use. |
boolean |
deleteOwner(java.security.Principal caller,
java.security.Principal owner)
Deletes an owner. |
java.util.Enumeration |
entries()
Returns an enumeration of the entries in this ACL. |
java.lang.String |
getName()
This will return the name of the Acl |
java.util.Enumeration |
getPermissions(java.security.Principal user)
Returns an enumeration for the set of allowed permissions for the specified principal (representing an entity such as an individual or a group). |
boolean |
isOwner(java.security.Principal owner)
Returns true if the given principal is an owner of the ACL. |
static void |
main(java.lang.String[] argv)
Main ** |
boolean |
removeEntry(java.security.Principal caller,
java.security.acl.AclEntry entry)
Removes an ACL entry from this ACL. |
void |
setName(java.security.Principal caller,
java.lang.String name)
Sets the name of this ACL. |
java.lang.String |
showPermissions(java.security.Principal user)
simple debug rtn to display permissions for a user |
java.lang.String |
toString()
Returns a string representation of the ACL contents. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public TsAcl(java.lang.String name,
java.security.Principal owner)
name - Name for the resulting Aclowner - Principal for the owner of the ACL| Method Detail |
public java.lang.String getName()
public void setName(java.security.Principal caller,
java.lang.String name)
throws java.security.acl.NotOwnerException
caller - the principal invoking this method. It must be an
owner of this ACL.name - the name to be given to this ACL.
public boolean addEntry(java.security.Principal caller,
java.security.acl.AclEntry entry)
throws java.security.acl.NotOwnerException
caller - the principal invoking this method. It must be an
owner of this ACL.entry - the ACL entry to be added to this ACL.
public boolean removeEntry(java.security.Principal caller,
java.security.acl.AclEntry entry)
throws java.security.acl.NotOwnerException
caller - the principal invoking this method. It must be an
owner of this ACL.entry - the ACL entry to be removed from this ACL.public java.util.Enumeration getPermissions(java.security.Principal user)
The individual positive and negative permission sets are also determined. The positive permission set contains the permissions specified in the positive ACL entry (if any) for the principal. Similarly, the negative permission set contains the permissions specified in the negative ACL entry (if any) for the principal. The individual positive (or negative) permission set is considered to be null if there is not a positive (negative) ACL entry for the principal in this ACL.
The set of permissions granted to the principal is then calculated using the simple rule that individual permissions always override the group permissions. That is, the principal's individual negative permission set (specific denial of permissions) overrides the group positive permission set, and the principal's individual positive permission set overrides the group negative permission set.
user - the principal whose permission set is to be returned.
public boolean checkPermission(java.security.Principal user,
java.security.acl.Permission permission)
getPermissions method.user - the principal, assumed to be a valid authenticated Principal.permission - the permission to be checked for.getPermissions(java.security.Principal)public java.lang.String showPermissions(java.security.Principal user)
public java.util.Enumeration entries()
public java.lang.String toString()
public java.lang.String debug()
public boolean addOwner(java.security.Principal caller,
java.security.Principal owner)
throws java.security.acl.NotOwnerException
caller - the principal invoking this method. It must be an owner
of the ACL.owner - the owner that should be added to the list of owners.
public boolean deleteOwner(java.security.Principal caller,
java.security.Principal owner)
throws java.security.acl.NotOwnerException,
java.security.acl.LastOwnerException
The caller principal must be an owner of the ACL in order to invoke this method.
caller - the principal invoking this method. It must be an owner
of the ACL.owner - the owner to be removed from the list of owners.public boolean isOwner(java.security.Principal owner)
owner - the principal to be checked to determine whether or not
it is an owner.public static void main(java.lang.String[] argv)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||