public class PCAccessHelper extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
PCAccessHelper() |
Modifier and Type | Method and Description |
---|---|
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
|
public static final int NONE
public static final int READ
public static final int CREATE_CONTAINER
public static final int CREATE_ITEM
public static final int CREATE_REFERENCE
public static final int MODIFY
public static final int MODIFY_REFERENCE
public static final int MODIFY_PERMISSION
public static final int DELETE
public static final int DELETE_REFERENCE
public static final int ALL
public static int getAccess(URI itemID, URI userID) throws Exception
itemID
- the MWS thing ID of the resource to get access rights foruserID
- the URI of the principal to retrieve rights forPCAccessHelper
for bit-field constants.Exception
public static boolean hasAccess(URI itemID, URI userID, int accessRights) throws Exception
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.Exception