com.webmethods.caf.portalclient.access
Class PCAccessHelper

java.lang.Object
  extended by com.webmethods.caf.portalclient.access.PCAccessHelper

public class PCAccessHelper
extends Object

Simplifies getting some basic access information


Field Summary
static int ALL
           
static int CREATE_CONTAINER
           
static int CREATE_ITEM
           
static int CREATE_REFERENCE
           
static int DELETE
           
static int DELETE_REFERENCE
           
static int MODIFY
           
static int MODIFY_PERMISSION
           
static int MODIFY_REFERENCE
           
static int NONE
           
static int READ
           
 
Constructor Summary
PCAccessHelper()
           
 
Method Summary
static int getAccess(URI itemID, URI userID)
          Determines what the access rights a user has on a resource
static boolean hasAccess(URI itemID, URI userID, int accessRights)
          Determines whether the user has the specified rights on a resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

READ

public static final int READ
See Also:
Constant Field Values

CREATE_CONTAINER

public static final int CREATE_CONTAINER
See Also:
Constant Field Values

CREATE_ITEM

public static final int CREATE_ITEM
See Also:
Constant Field Values

CREATE_REFERENCE

public static final int CREATE_REFERENCE
See Also:
Constant Field Values

MODIFY

public static final int MODIFY
See Also:
Constant Field Values

MODIFY_REFERENCE

public static final int MODIFY_REFERENCE
See Also:
Constant Field Values

MODIFY_PERMISSION

public static final int MODIFY_PERMISSION
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

DELETE_REFERENCE

public static final int DELETE_REFERENCE
See Also:
Constant Field Values

ALL

public static final int ALL
See Also:
Constant Field Values
Constructor Detail

PCAccessHelper

public PCAccessHelper()
Method Detail

getAccess

public static int getAccess(URI itemID,
                            URI userID)
                     throws Exception
Determines what the access rights a user has on a resource

Parameters:
itemID - the MWS thing ID of the resource to get access rights for
userID - the URI of the principal to retrieve rights for
Returns:
the bit-field of rights explictly granted to the specified principal. See PCAccessHelper for bit-field constants.
Throws:
Exception

hasAccess

public static boolean hasAccess(URI itemID,
                                URI userID,
                                int accessRights)
                         throws Exception
Determines whether the user has the specified rights on a resource

Parameters:
itemID - the MWS thing ID of the resource to check access rights for
userID - the URI of the principal to check access rights for
accessRights - the bit-field of rights to check against. See PCAccessHelper for bit-field constants.
Returns:
true if the user has access, false otherwise
Throws:
Exception