com.sas.drugdev.remote.repository.security
Interface AccessControlEntry


public interface AccessControlEntry

Represents an entry in an AccessControlList. An AccessControlEntry contains a principal and a set of Permission objects. The principal can be either a group or a user. The user doesn't have to be userid; it can also be the "owner" of the object.


Field Summary
static java.lang.String GROUP_ALL_USERS
          Name for a special group, which is all users.
static java.lang.String USER_OWNER
          Name for a special user, which is the owner of this node.
 
Method Summary
 void addPermission(Permission permission)
          Add the given permission to this entry.
 java.lang.String getName()
          Get the name of this AccessControlEntry.
 boolean hasPermission(Permission permission)
          Test whether this entry contains the given permission.
 boolean isGroupEntry()
          Test whether this AccessControlEntry is associated with a group.
 boolean isUserEntry()
          Test whether this AccessControEntry is associated with a user.
 void removePermission(Permission permission)
          Remove the given permission from this entry.
 void setPermissions(java.util.Set permissions)
          Set the permissions on this entry to the set of permissions passed in.
 

Field Detail

GROUP_ALL_USERS

public static final java.lang.String GROUP_ALL_USERS
Name for a special group, which is all users. There will always be one and only one AccessControlEntry with this name in each AccessControlEntry.

See Also:
Constant Field Values

USER_OWNER

public static final java.lang.String USER_OWNER
Name for a special user, which is the owner of this node. There will always be one and only one AccessControlEntry with this name in each AccessControlEntry.

See Also:
Constant Field Values
Method Detail

hasPermission

public boolean hasPermission(Permission permission)
Test whether this entry contains the given permission.

Parameters:
permission - permission to check for
Returns:
true if this entry contains the given permission.

addPermission

public void addPermission(Permission permission)
                   throws InvalidTypeException
Add the given permission to this entry.

Parameters:
permission - permission to add
Throws:
InvalidTypeException - If the node that this entry points to is a file and the permission passed in is a container permission, e.g. Permission.INHERIT_READ_PERMISSION

removePermission

public void removePermission(Permission permission)
Remove the given permission from this entry. If this entry doesn't have this permission, this method is a no-op.

Parameters:
permission - permission to remove

setPermissions

public void setPermissions(java.util.Set permissions)
                    throws InvalidTypeException
Set the permissions on this entry to the set of permissions passed in. All existing ppermissions are overwritten.

Parameters:
permissions - Set of Permission objects
Throws:
InvalidTypeException - If the node that this entry points to is a file and one or more of the permissions passed in is a container permission, e.g. Permission.INHERIT_READ_PERMISSION

isUserEntry

public boolean isUserEntry()
Test whether this AccessControEntry is associated with a user.

Returns:
true if this entry is associated with a user

isGroupEntry

public boolean isGroupEntry()
Test whether this AccessControlEntry is associated with a group.

Returns:
true if this entry is associated with a group

getName

public java.lang.String getName()
Get the name of this AccessControlEntry. If this is a user entry, this is a userid. If this is a group entry, this is a group name. This could also be either GROUP_ALL_USERS or USER_OWNER.

Returns:
the name associated with this entry