com.webmethods.caf.portalclient.access
Class PCAccessHelper
java.lang.Object
com.webmethods.caf.portalclient.access.PCAccessHelper
public class PCAccessHelper
- extends Object
Simplifies getting some basic access information
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 |
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
PCAccessHelper
public PCAccessHelper()
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 foruserID
- 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 foruserID
- the URI of the principal to check access rights foraccessRights
- 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