@Path(value="/perm")
@Produces(value="application/json")
public interface PermResource
The following table can be used to look up the bit positions (starting at 0) of the folder permissions:
Type | Short | Description | Bit |
---|---|---|---|
Folder | s | Show | 0 |
r | Assign user permissions | 1 | |
c | Create | 8 | |
e | Edit | 9 | |
d | Delete | 10 | |
Pages/Images/Files | s | Show | 11 |
c | Create | 12 | |
e | Edit | 13 | |
d | Delete | 14 | |
i | Import | 23 | |
Pages | p | Publish | 19 |
Templates | s | Show | 15 |
c | Create | 16 | |
l | Link | 21 | |
e | Edit | 17 | |
d | Delete | 18 | |
Workflow | v | Link | 22 |
The following table can be used to look up the bit positions (starting at 0) of the role permissions:
Type | Description | Bit |
---|---|---|
Role permissions | Show | 10 |
Create | 11 | |
Modify | 12 | |
Delete | 13 | |
Publishing | 14 | |
Translate | 15 |
Modifier and Type | Method and Description |
---|---|
PermResponse |
getObjectPermission(Permission perm,
String objType,
int objId,
int nodeId)
Check whether the user has permission perm on the object defined by type and id
|
PermBitsResponse |
getPermissions(String objType,
boolean privilegeMap)
Get the permission bits valid for the current user and the given type
|
PermBitsResponse |
getPermissions(String objType,
int objId,
int nodeId,
int checkType,
int languageId,
boolean privilegeMap)
Get the permission bits valid for the current user on the given object (and optionally for the given node).
|
GroupsPermBitsResponse |
list(String objType)
List all groups with with their permission bits for the given object type
This only lists groups that the current user actually
has permission to view (his own groups and their sub groups)
|
GroupsPermBitsResponse |
list(String 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(String objType,
int objId,
long waitMs,
SetPermsRequest req)
Set the permissions on the identified object according to the posted request
|
GenericResponse |
setPermissions(String type,
long waitMs,
SetPermsRequest req)
Set the permissions on the type
|
@GET @Path(value="/{type}") PermBitsResponse getPermissions(@PathParam(value="type") String objType, @QueryParam(value="map") @DefaultValue(value="false") boolean privilegeMap) throws Exception
objType
- object typeprivilegeMap
- true if the privileges should also be returned as mapException
@GET @Path(value="/{type}/{id}") PermBitsResponse getPermissions(@PathParam(value="type") String objType, @PathParam(value="id") int objId, @QueryParam(value="nodeId") @DefaultValue(value="0") int nodeId, @QueryParam(value="type") @DefaultValue(value="-1") int checkType, @QueryParam(value="lang") @DefaultValue(value="0") int languageId, @QueryParam(value="map") @DefaultValue(value="false") boolean privilegeMap) throws Exception
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).
objType
- object type (10002 = Folder, 10001 = Node)objId
- object idnodeId
- optional node idcheckType
- 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 returnedprivilegeMap
- true if the privileges should also be returned as mapException
@GET @Path(value="/{perm}/{type}/{id}") PermResponse getObjectPermission(@PathParam(value="perm") Permission perm, @PathParam(value="type") String objType, @PathParam(value="id") int objId, @QueryParam(value="nodeId") @DefaultValue(value="0") int nodeId) throws Exception
perm
- permissionobjType
- object typeobjId
- object idnodeId
- node idException
@POST @Path(value="/{type}") GenericResponse setPermissions(@PathParam(value="type") String type, @QueryParam(value="wait") @DefaultValue(value="0") long waitMs, SetPermsRequest req) throws Exception
type
- typewaitMs
- wait timeout in millisecondsreq
- requestException
@POST @Path(value="/{type}/{id}") GenericResponse setPermissions(@PathParam(value="type") String objType, @PathParam(value="id") int objId, @QueryParam(value="wait") @DefaultValue(value="0") long waitMs, SetPermsRequest req) throws Exception
objType
- object typeobjId
- object idwaitMs
- wait timeout in millisecondsreq
- requestException
@GET @Path(value="/list/{type}") GroupsPermBitsResponse list(@PathParam(value="type") String objType) throws Exception
objType
- Type of the objectException
@GET @Path(value="/list/{type}/{id}") GroupsPermBitsResponse list(@PathParam(value="type") String objType, @PathParam(value="id") int objId) throws Exception
objType
- Type of the objectobjId
- ID of the objectException
Copyright © 2024 Gentics Software. All rights reserved.