com.gentics.contentnode.rest.resource
Interface PermResource

All Superinterfaces:
AuthenticatedResource

public interface PermResource
extends AuthenticatedResource

Resource for reading and writing permissions.

The following table can be used to look up the bit positions (starting at 0) of the folder permissions:

TypeShortDescriptionBit
FoldersShow0
rAssign user permissions1
cCreate8
eEdit9
dDelete10
Pages/Images/FilessShow11
cCreate12
eEdit13
dDelete14
iImport23
PagespPublish19
TemplatessShow15
cCreate16
lLink21
eEdit17
dDelete18
WorkflowvLink22

The following table can be used to look up the bit positions (starting at 0) of the role permissions:

TypeDescriptionBit
Role permissionsShow10
Create11
Modify12
Delete13
Publishing14
Translate15


Method Summary
 PermResponse getObjectPermission(Permission perm, int objType, int objId, int nodeId)
          Check whether the user has permission perm on the object defined by type and id
 PermBitsResponse getPermissions(int objType, int objId, int nodeId, int checkType, int languageId)
          Get the permission bits valid for the current user on the given object (and optionally for the given node).
 GroupsPermBitsResponse list(int objType, int objId)
          List all groups with with their permission bits for the given object This only lists groups that the current user actually has permission to view (his own groups and their sub groups)
 GenericResponse setPermissions(int objType, int objId, SetPermsRequest req)
          Set the permissions on the identified object according to the posted request
 
Methods inherited from interface com.gentics.contentnode.rest.resource.AuthenticatedResource
setSessionId
 

Method Detail

getPermissions

PermBitsResponse getPermissions(int objType,
                                int objId,
                                int nodeId,
                                int checkType,
                                int languageId)
Get the permission bits valid for the current user on the given object (and optionally for the given node).

See the class description for the permission bits.
To get the folder permissions you need to provide the type (10002 = Folder, 10001 = Node) and the object id.
To get the role permissions you need to provide the languageId and the type to check for (10007 = Pages, 10008 = Files).

Parameters:
objType - object type (10002 = Folder, 10001 = Node)
objId - object id
nodeId - optional node id
checkType - optional type for which the role permission should be returned (10007 = Pages, 10008 = Files)
languageId - optional language id for which the role permissions should be returned
Returns:
permission bits response

getObjectPermission

PermResponse getObjectPermission(Permission perm,
                                 int objType,
                                 int objId,
                                 int nodeId)
Check whether the user has permission perm on the object defined by type and id

Parameters:
perm - permission
objType - object type
objId - object id
nodeId - node id
Returns:
response containing the result

setPermissions

GenericResponse setPermissions(int objType,
                               int objId,
                               SetPermsRequest req)
Set the permissions on the identified object according to the posted request

Parameters:
objType - object type
objId - object id
req - request
Returns:
generic response

list

GroupsPermBitsResponse list(int objType,
                            int objId)
List all groups with with their permission bits for the given object This only lists groups that the current user actually has permission to view (his own groups and their sub groups)

Parameters:
objType - Type of the object
objId - ID of the object
Returns:
generic GroupsPermBitsResponse object


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.