Project: stp

com.ibm.rational.wvcm.stp
Interface StpAccessControlEntry


public interface StpAccessControlEntry

The interface for an entry in a resource's access control list. Each access control entry denotes access rights to a specific resource granted to one or more principals (denoted by a group, user, or role).

In addition, each StpAccessControlEntry instance returned by this API specifies whether the entry represents an access right applied directly to the resource or an access right derived from access rights applied to one or more related resources. In most cases, the resource to which the effective access right is actually applied is also included in the StpAccessControlEntry returned from the API.

To add an access control entry to a resource an instance of StpAccessControlEntry is required. It can be constructed using StpProvider.buildAccessControlEntry(StpPrincipal, com.ibm.rational.wvcm.stp.StpAccessControlEntry.AccessRight[]) if the access right is known a priori or by requesting the StpAccessControlledResource.POSSIBLE_ACCESS_RIGHTS property and selecting one of those. When adding an access control entry to a resource, only the access rights and principal fields of the StpAccessControlEntry object are significant.

Resources that may have access control lists applied them implement the StpAccessControlledResource interface.

Resources that represent entities to which access rights may be granted implement the StpPrincipal interface.


Nested Class Summary
static class StpAccessControlEntry.AccessRight
          An enumeration of the possible access rights that can be applied to a controlled resource.
static class StpAccessControlEntry.EntryType
          An enumeration of the type of permission being reported
 
Method Summary
 boolean allowsRead()
           
 boolean allowsWrite()
           
 StpAccessControlEntry.AccessRight[] getAccessRights()
           
 StpAccessControlledResource getAppliedResource()
           
 StpAccessControlledResource getControlledResource()
           
 StpAccessControlEntry.EntryType getEntryType()
           
 StpPrincipal getPrincipal()
           
 void setAccessRights(StpAccessControlEntry.AccessRight... accessRights)
          Defines a new value for the access rights granted by this entry.
 void setControlledResource(StpAccessControlledResource controlledResource)
          Assigns a new value to the controlled resource of this entry.
 void setPrincipal(StpPrincipal principal)
          Assigns a new value for the principal of this access control entry.
 

Method Detail

allowsRead

boolean allowsRead()
Returns:
true iff this access control entry grants reading of the controlled resource to the principal

allowsWrite

boolean allowsWrite()
Returns:
true iff this access control entry allows writing of the controlled resource by the principal

getAccessRights

StpAccessControlEntry.AccessRight[] getAccessRights()
Returns:
The access rights granted by this entry to the principal on the controlled resource. Will never be null.

getAppliedResource

StpAccessControlledResource getAppliedResource()
Returns:
The resource to which this access control entry was actually applied, if known; null otherwise.

getControlledResource

StpAccessControlledResource getControlledResource()
Returns:
The resource whose access is controlled by this access control entry; will be null if no resource has been associated with this StpAccessControlEntry instance.

getEntryType

StpAccessControlEntry.EntryType getEntryType()
Returns:
The type of access control entry being reported by this instance.

getPrincipal

StpPrincipal getPrincipal()
Returns:
The group, user, or role that is granted the access rights of this entry to the controlled resource; null if no principal has been associated with this permission.

setAccessRights

void setAccessRights(StpAccessControlEntry.AccessRight... accessRights)
Defines a new value for the access rights granted by this entry.

Parameters:
accessRights - An array of access right instances specifying the access rights granted by this entry; must not be null or empty.

setControlledResource

void setControlledResource(StpAccessControlledResource controlledResource)
Assigns a new value to the controlled resource of this entry.

Parameters:
controlledResource - An StpResource proxy specifying the resource to be controlled by this entry. Not all resource types can be controlled by an access control list.

setPrincipal

void setPrincipal(StpPrincipal principal)
Assigns a new value for the principal of this access control entry.

Parameters:
principal - An StpResource proxy specifying the group, user, or role identifying the principals granted access rights by this entry. Not all resources accept all types of principals.

Generated Tue 7-Feb-2017 11:15 PM

Copyright © IBM 2017. All rights reserved.