com.starbase.starteam
Class AccessRightsManager

java.lang.Object
  |
  +--com.starbase.starteam.AccessRightsManager

public class AccessRightsManager
extends java.lang.Object

Provides utilities for manipulating access rights.

Access rights information is fetched from the server as necessary, and cached to improve performance of subsequent access tests.


Constructor Summary
AccessRightsManager(Server s)
          Creates a new access rights manager for the given server.
 
Method Summary
 AccessTestResults accessTest(int userID, int permissions, EffectiveACE[] acl)
          Determines whether or not the given user is granted the given permissions to a securable object with the given access control list.
 AccessTestResults accessTest(int userID, int permissions, ISecurable obj)
          Performs an access test against the given securable object.
 AccessTestResults accessTest(int userID, int permissions, ISecurableContainer container, Type type)
          Performs an access test against the given securable container.
 void discard()
          Discards cached access rights information.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 EffectiveACE[] getEffectiveACL(ISecurable obj)
          Gets the effective access control list for the given securable object.
 EffectiveACE[] getEffectiveContainerACL(ISecurableContainer container, Type type)
          Gets the effective access control list for objects of a given type in a given securable container.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isAccessGranted(int userID, int permissions, EffectiveACE[] acl)
          Determines whether or not the given user is granted the given permissions to a securable object with the given access control list.
 boolean isAccessGranted(int userID, int permissions, ISecurable obj)
          Determines whether or not the given user is granted the given permissions to the given securable object.
 boolean isAccessGranted(int userID, int permissions, ISecurableContainer container, Type type)
          Determines whether or not the given user is granted the given permissions to the given securable container.
 void refresh()
          Refreshes cached access rights information to reflect recent changes to the server.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessRightsManager

public AccessRightsManager(Server s)
Creates a new access rights manager for the given server.

Parameters:
s - The server whose access rights are to be managed.
Method Detail

refresh

public void refresh()
Refreshes cached access rights information to reflect recent changes to the server.


discard

public void discard()
Discards cached access rights information. Access rights information will be fetched from the server as needed.


getEffectiveACL

public EffectiveACE[] getEffectiveACL(ISecurable obj)
Gets the effective access control list for the given securable object.

The effective access control list completely encompasses all information used by the server to perform an access test for the given object.

This might include an object-level ACL defined for the object itself, or a container-level ACL defined on a parent folder, or on the view or project, as well as implied ACEs resulting from group privileges, object ownership, and so on.

Parameters:
obj - A securable object.
Returns:
The effective access control list for the given securable object.
See Also:
ISecurable, EffectiveACE, AccessRightsManager.isAccessGranted(int, int, EffectiveACE[]), AccessRightsManager.accessTest(int, int, EffectiveACE[])

getEffectiveContainerACL

public EffectiveACE[] getEffectiveContainerACL(ISecurableContainer container,
                                               Type type)
Gets the effective access control list for objects of a given type in a given securable container.

The effective access control list completely encompasses all information used by the server to perform an access test for the given object.

This might include an object-level ACL defined for the object itself, or a container-level ACL defined on a parent folder, or on the view or project, as well as implied ACEs resulting from group privileges, object ownership, and so on.

Parameters:
container - A securable container.
type - The object type.
Returns:
The effective access control list for the given securable object.
See Also:
ISecurableContainer, EffectiveACE, AccessRightsManager.isAccessGranted(int, int, EffectiveACE[]), AccessRightsManager.accessTest(int, int, EffectiveACE[])

isAccessGranted

public boolean isAccessGranted(int userID,
                               int permissions,
                               ISecurable obj)
Determines whether or not the given user is granted the given permissions to the given securable object.

Determining the effective access control list for a securable object is a reasonably expensive operation. For applications that need to perform multiple access tests on the same securable object, consider using the form of isAccessGranted() that takes the effective ACL as a parameter.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
obj - The securable object against which the test is performed.
Returns:
true if the user is granted all the requested permissions; false if at least one of the requested permissions is denied.
See Also:
Permissions, ISecurable, AccessRightsManager.getEffectiveACL(ISecurable), AccessRightsManager.isAccessGranted(int,int,EffectiveACE[])

isAccessGranted

public boolean isAccessGranted(int userID,
                               int permissions,
                               ISecurableContainer container,
                               Type type)
Determines whether or not the given user is granted the given permissions to the given securable container.

Determining the effective access control list for a securable container is a reasonably expensive operation. For applications that need to perform multiple access tests on the same securable object, consider using the form of isAccessGranted() that takes the effective ACL as a parameter.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
container - The securable container against which the test is performed.
type - The type of object for which the test is performed.
Returns:
true if the user is granted all the requested permissions; false if at least one of the requested permissions is denied.
See Also:
Permissions, ISecurable, AccessRightsManager.getEffectiveContainerACL(ISecurableContainer,Type), AccessRightsManager.isAccessGranted(int,int,EffectiveACE[])

isAccessGranted

public boolean isAccessGranted(int userID,
                               int permissions,
                               EffectiveACE[] acl)
Determines whether or not the given user is granted the given permissions to a securable object with the given access control list.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
acl - The access control list against which the test is performed.
Returns:
true if the user is granted all the requested permissions; false if at least one of the requested permissions is denied.
See Also:
Permissions, EffectiveACE, AccessRightsManager.getEffectiveACL(ISecurable)

accessTest

public AccessTestResults accessTest(int userID,
                                    int permissions,
                                    ISecurable obj)
Performs an access test against the given securable object.

Determining the effective access control list for a securable object is a reasonably expensive operation. For applications that need to perform multiple access tests on the same securable object, consider using the form of accessTest() that takes the effective ACL as a parameter.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
obj - The securable object against which the test is performed.
Returns:
A detailed explanation of the results of the access test.
See Also:
Permissions, ISecurable, AccessTestResults, AccessRightsManager.getEffectiveACL(ISecurable), AccessRightsManager.accessTest(int,int,EffectiveACE[])

accessTest

public AccessTestResults accessTest(int userID,
                                    int permissions,
                                    ISecurableContainer container,
                                    Type type)
Performs an access test against the given securable container.

Determining the effective access control list for a securable object is a reasonably expensive operation. For applications that need to perform multiple access tests on the same securable object, consider using the form of accessTest() that takes the effective ACL as a parameter.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
container - The securable container against which the test is performed.
type - The type of object for which the test is performed.
Returns:
A detailed explanation of the results of the access test.
See Also:
Permissions, ISecurable, AccessTestResults, AccessRightsManager.getEffectiveContainerACL(ISecurableContainer,Type), AccessRightsManager.accessTest(int,int,EffectiveACE[])

accessTest

public AccessTestResults accessTest(int userID,
                                    int permissions,
                                    EffectiveACE[] acl)
Determines whether or not the given user is granted the given permissions to a securable object with the given access control list.

Parameters:
userID - The userID of the user for which the access test is performed.
permissions - The set of permission flags to be tested.
acl - The access control list against which the test is performed.
Returns:
A detailed explanation of the results of the access test.
See Also:
Permissions, EffectiveACE, AccessTestResults, AccessRightsManager.getEffectiveACL(ISecurable)

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.