SilverStream
Application Server 3.5

com.sssw.rts.acl
Class AgoAclEntry

java.lang.Object
 |
 +--com.sssw.rts.acl.AgoAclEntry
All Implemented Interfaces:
AclEntry, Cloneable

public class AgoAclEntry
extends Object
implements AclEntry

Represents the access rights to a SilverStream object as an Access Control List. Note that not all SilverStream access rights are representable as an access control list -- only those that constitute "simple expressions".

See Also:
Acl, AclEntry, AgoAcl

Constructor Summary
AgoAclEntry()
           
 
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.
 Object clone()
          Clones this ACL entry.
 Principal getPrincipal()
          Returns the principal for which permissions are granted or denied by this ACL entry.
 boolean isNegative()
          Returns true if this is a negative ACL entry (one denying the associated principal the set of permissions in the entry), false otherwise.
 Enumeration permissions()
          Returns an enumeration of the permissions in this ACL entry.
 boolean removePermission(Permission permission)
          Removes the specified permission from this ACL entry.
 void setNegativePermissions()
          Sets this ACL entry to be a negative one.
 boolean setPrincipal(Principal user)
          Specifies the principal for which permissions are granted or denied by this ACL entry.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoAclEntry

public AgoAclEntry()
Method Detail

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.
Usage:

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 Principal pr = ...
 boolean success = myAclEntry.setPrincipal(pr);
 

getPrincipal

public Principal getPrincipal()
Returns the principal for which permissions are granted or denied 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.
Usage:

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 Principal pr = myAclEntry.getPrincipal();
 

setNegativePermissions

public void setNegativePermissions()
Sets this ACL entry to be a negative one. That is, the associated principal (e.g., a user or a group) will be denied the permission set specified in the entry. Note: ACL entries are by default positive. An entry becomes a negative entry only if this method is called on it.
Specified by:
setNegativePermissions in interface AclEntry
Usage:

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 myAclEntry.setNegativePermissions();
 

isNegative

public boolean isNegative()
Returns true if this is a negative ACL entry (one denying the associated principal the set of permissions in the entry), false otherwise.
Specified by:
isNegative in interface AclEntry
Returns:
true if this is a negative ACL entry, false if it's not.
Usage:

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 boolean isNegative = myAclEntry.isNegative();
 

addPermission

public boolean addPermission(Permission permission)
Adds the specified permission to this ACL entry. 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.
Usage:

For a list of permission types, see AgoPermission.

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 AgoPermission permission = ...
 boolean success = myAclEntry.addPermission(permission);
 

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.
Usage:

For a list of permission types, see AgoPermission.

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 boolean success = myAclEntry.removePermission(permission);
 

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.
Usage:

For a list of permission types, see AgoPermission.

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 boolean isPermPartOfSet = myAclEntry.checkPermission(permission);
 

permissions

public Enumeration permissions()
Returns an enumeration of the permissions in this ACL entry.
Specified by:
permissions in interface AclEntry
Returns:
an enumeration of the permissions in this ACL entry.
Usage:

This method is from java.security.acl.AclEntry.

Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 Enumeration e = myAclEntry.permissions();
 

clone

public Object clone()
Clones this ACL entry.
Specified by:
clone in interface AclEntry
Overrides:
clone in class Object
Returns:
a clone of this ACL entry.
Example:
AgoAclEntry myAclEntry = server.createAclEntry();
 // ... some processing
 Object clone = myAclEntry.clone();
 

SilverStream
Application Server 3.5