|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.AccessRightsManager
public final class AccessRightsManager
A generalized access rights cache for all types of StarTeam artifacts and Containers For optimized results, the cache should be pre-loaded with ACLs for each and every relevant artifact (or container)
Access rights information is fetched from the server as necessary, using bulk queries to minimize server traffic, and cached to improve performance of subsequent access tests. From 12.0 release of the server onwards, MPX events are triggered by the server in case of access rights changes and helps optimizing server calls. All access tests are in-memory operations This class is thread-safe and supports a multi reader single writer concurrency pattern
| Nested Class Summary | |
|---|---|
static class |
AccessRightsManager.AccessTestResults
Represents the results of an access test. |
| Constructor Summary | |
|---|---|
AccessRightsManager(Server s)
Creates a new access rights manager for the given server. |
|
| Method Summary | |
|---|---|
AccessRightsManager.AccessTestResults |
accessTest(Principal principal,
PermissionCollection permissions,
EffectiveACE[] acl)
Determines whether or not the given principal is granted the given permissions to a securable object with the given access control list. |
AccessRightsManager.AccessTestResults |
accessTest(Principal principal,
PermissionCollection permissions,
ISecurable obj)
Performs an access test against the given securable object. |
AccessRightsManager.AccessTestResults |
accessTest(Principal principal,
PermissionCollection permissions,
ISecurableContainer container,
Type type)
Performs an access test against the given securable container. |
void |
discard()
Discards cached access rights information. |
EffectiveACE[] |
getEffectiveRights(ISecurable obj)
Gets the effective access control list for the given securable object. |
EffectiveACE[] |
getEffectiveRights(ISecurableContainer container,
Type type)
Gets the effective access control list for objects of a given type in a given securable container. |
ACE[] |
getRights(ISecurable securable)
Returns the Access Control List for this securable object. |
ACE[] |
getRights(ISecurableContainer securable,
Type type)
Returns the Access Control List for items of the specified type for this container. |
boolean |
isAccessGranted(Principal principal,
PermissionCollection permissions,
EffectiveACE[] acl)
Determines whether or not the given principal is granted the given permissions to a securable object with the given access control list. |
boolean |
isAccessGranted(Principal principal,
PermissionCollection permissions,
ISecurable obj)
Determines whether or not the given principal is granted the given permissions to the given securable object. |
boolean |
isAccessGranted(Principal principal,
PermissionCollection permissions,
ISecurableContainer container,
Type type)
Determines whether or not the given principal is granted the given permissions to the given securable container. |
boolean |
isCached(ISecurable object)
returns true if ACLs for the specified securable have already been cached An access rights test against a securable that has not been cached will still succeed since the manager will issue server calls in the content of the test However, the resultant operation would be fairly expensive |
boolean |
isCached(ISecurableContainer object,
Type type)
returns true if ACLs for the specified securable container have already been cached An access rights test against a securable container that has not been cached will still succeed since the manager will issue server calls in the content of the test However, the resultant operation would be fairly expensive |
void |
populate(ISecurable object)
Populates the access control list for this securable The cache is maintained in memory until cleared by a call to discard |
void |
populate(ISecurable[] securables)
Populates the access control list for all the members of this securable collection using the fewest server commands possible The cache is maintained in memory until cleared by a call to discard |
void |
populate(ISecurableContainer[] securables,
Type type)
Populates the access control list for all the members of this securable container collection using the fewest server commands possible The cache is maintained in memory until cleared by a call to discard |
void |
populate(ISecurableContainer securable,
Type type)
Populates the access control list for this securable container |
void |
populateAll(ISecurable[] securables)
Populates the access control lists for all the members of this collections, parent containers if any, and effective access control lists for these members and their parent containers |
void |
refresh()
Refreshes cached access rights information to reflect recent changes to the server. |
void |
refresh(ISecurable object)
refresh a single securable to reflect changes made to the object From 12.0 release of the server onwards, MPX events are triggered by the server in case of access rights changes thereby minimizing server calls. |
void |
refresh(ISecurable[] objects)
refresh a set of securables to reflect changes made to the objects From 12.0 release of the server onwards, MPX events are triggered by the server in case of access rights changes thereby minimizing server calls. |
void |
refresh(ISecurableContainer[] objects,
Type type)
refresh a set of securable containers to reflect changes made to the objects From 12.0 release of the server onwards, MPX events are triggered by the server in case of access rights changes thereby optimizing server calls. |
void |
refresh(ISecurableContainer object,
Type type)
refresh a single securable container to reflect changes made to the object From 12.0 release of the server onwards, MPX events are triggered by the server in case of access rights changes thereby minimizing server calls. |
void |
remove(ISecurable object)
Remove a securable from this access rights manager Typically, applications will remove securables that have been deleted |
void |
remove(ISecurable[] objects)
Remove a set of securables from this access rights manager |
void |
remove(ISecurableContainer[] objects,
Type type)
Remove a set of Securable Containers from this access rights manager |
void |
remove(ISecurableContainer object,
Type type)
Remove a Securable Container from this access rights manager |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AccessRightsManager(Server s)
s - The server whose access rights are to be managed.| Method Detail |
|---|
public void refresh()
public void refresh(ISecurable object)
object - the securable to refresh in this managerpublic void refresh(ISecurable[] objects)
objects - the securables to refresh in this manager
public void refresh(ISecurableContainer[] objects,
Type type)
objects - the securable containers to refresh in this managertype - the owning type
public void refresh(ISecurableContainer object,
Type type)
object - the securable container to refresh in this managertype - the owning typepublic void discard()
public EffectiveACE[] getEffectiveRights(ISecurable obj)
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.
obj - A securable object.
ISecurable,
EffectiveACE,
AccessRightsManager.isAccessGranted(Principal, PermissionCollection, EffectiveACE[]),
AccessRightsManager.accessTest(Principal, PermissionCollection, EffectiveACE[])
public EffectiveACE[] getEffectiveRights(ISecurableContainer container,
Type type)
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.
container - A securable container.type - The object type.
ISecurableContainer,
EffectiveACE,
AccessRightsManager.isAccessGranted(Principal, PermissionCollection, EffectiveACE[]),
AccessRightsManager.accessTest(Principal, PermissionCollection, EffectiveACE[])public void populateAll(ISecurable[] securables)
securables - a collection of securable objectsAccessRightsManager.populate(ISecurable[]),
AccessRightsManager.populate(ISecurableContainer[], Type),
AccessRightsManager.getEffectiveRights(ISecurable),
AccessRightsManager.getEffectiveRights(ISecurableContainer, Type)public boolean isCached(ISecurable object)
object - the securable to test
public boolean isCached(ISecurableContainer object,
Type type)
object - the securable container to testtype - the owning type
public void populate(ISecurable object)
object - a single securable object.AccessRightsManager.getRights(ISecurable),
AccessRightsManager.discard()public void remove(ISecurable object)
object - the securable to remove from the manager
public void remove(ISecurableContainer object,
Type type)
object - the securable container to remove from the managertype - the type associated with the container
public void remove(ISecurableContainer[] objects,
Type type)
objects - the securable containers to remove from the managertype - the type associated with the containerpublic void remove(ISecurable[] objects)
objects - the securables to remove from the managerpublic void populate(ISecurable[] securables)
securables - a collection of securable objects.AccessRightsManager.getRights(ISecurable),
AccessRightsManager.discard()
public void populate(ISecurableContainer securable,
Type type)
securable - a securable containertype - the owning typeAccessRightsManager.getRights(ISecurableContainer, Type),
AccessRightsManager.discard()
public void populate(ISecurableContainer[] securables,
Type type)
securables - a collection of securable containers.type - the owning typeAccessRightsManager.getRights(ISecurableContainer, Type),
AccessRightsManager.discard()public ACE[] getRights(ISecurable securable)
securable - A securable object.
AccessRightsManager.populate(ISecurable[])
public ACE[] getRights(ISecurableContainer securable,
Type type)
securable - A securable container objecttype - the type being controlled by the returned ACL
AccessRightsManager.populate(ISecurableContainer[], Type),
Type
public boolean isAccessGranted(Principal principal,
PermissionCollection permissions,
ISecurable obj)
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.
principal - The principal 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.
ISecurable,
AccessRightsManager.getEffectiveRights(ISecurable),
AccessRightsManager.isAccessGranted(Principal,PermissionCollection,EffectiveACE[])
public boolean isAccessGranted(Principal principal,
PermissionCollection permissions,
ISecurableContainer container,
Type type)
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.
principal - The principal 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.
ISecurable,
AccessRightsManager.getEffectiveRights(ISecurableContainer,Type),
AccessRightsManager.isAccessGranted(Principal,PermissionCollection,EffectiveACE[])
public boolean isAccessGranted(Principal principal,
PermissionCollection permissions,
EffectiveACE[] acl)
principal - The principal 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.
EffectiveACE,
AccessRightsManager.getEffectiveRights(ISecurable)
public AccessRightsManager.AccessTestResults accessTest(Principal principal,
PermissionCollection permissions,
ISecurable obj)
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.
principal - The principalID of the principal 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.
ISecurable,
AccessRightsManager.AccessTestResults,
AccessRightsManager.getEffectiveRights(ISecurable),
AccessRightsManager.accessTest(Principal,PermissionCollection,EffectiveACE[])
public AccessRightsManager.AccessTestResults accessTest(Principal principal,
PermissionCollection permissions,
ISecurableContainer container,
Type type)
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.
principal - The principal 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.
ISecurable,
AccessRightsManager.AccessTestResults,
AccessRightsManager.getEffectiveRights(ISecurableContainer,Type),
AccessRightsManager.accessTest(Principal,PermissionCollection,EffectiveACE[])
public AccessRightsManager.AccessTestResults accessTest(Principal principal,
PermissionCollection permissions,
EffectiveACE[] acl)
principal - The principal 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.
EffectiveACE,
AccessRightsManager.AccessTestResults,
AccessRightsManager.getEffectiveRights(ISecurable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||