Interface PermResource
@Path("/perm")
@Produces("application/json")
public interface PermResource
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:
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 |
-
Method Summary
Modifier and TypeMethodDescriptiongetObjectPermission
(Permission perm, String objType, int objId, int nodeId) Check whether the user has permission perm on the object defined by type and idgetPermissions
(String objType, boolean privilegeMap) Get the permission bits valid for the current user and the given typegetPermissions
(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).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)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)setPermissions
(String objType, int objId, long waitMs, SetPermsRequest req) Set the permissions on the identified object according to the posted requestsetPermissions
(String type, long waitMs, SetPermsRequest req) Set the permissions on the type
-
Method Details
-
getPermissions
@GET @Path("/{type}") PermBitsResponse getPermissions(@PathParam("type") String objType, @QueryParam("map") @DefaultValue("false") boolean privilegeMap) throws Exception Get the permission bits valid for the current user and the given type- Parameters:
objType
- object typeprivilegeMap
- true if the privileges should also be returned as map- Returns:
- permission bits response
- Throws:
Exception
-
getPermissions
@GET @Path("/{type}/{id}") PermBitsResponse getPermissions(@PathParam("type") String objType, @PathParam("id") int objId, @QueryParam("nodeId") @DefaultValue("0") int nodeId, @QueryParam("type") @DefaultValue("-1") int checkType, @QueryParam("lang") @DefaultValue("0") int languageId, @QueryParam("map") @DefaultValue("false") boolean privilegeMap) throws Exception 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 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 map- Returns:
- permission bits response
- Throws:
Exception
-
getObjectPermission
@GET @Path("/{perm}/{type}/{id}") PermResponse getObjectPermission(@PathParam("perm") Permission perm, @PathParam("type") String objType, @PathParam("id") int objId, @QueryParam("nodeId") @DefaultValue("0") int nodeId) throws Exception Check whether the user has permission perm on the object defined by type and id- Parameters:
perm
- permissionobjType
- object typeobjId
- object idnodeId
- node id- Returns:
- response containing the result
- Throws:
Exception
-
setPermissions
@POST @Path("/{type}") GenericResponse setPermissions(@PathParam("type") String type, @QueryParam("wait") @DefaultValue("0") long waitMs, SetPermsRequest req) throws Exception Set the permissions on the type- Parameters:
type
- typewaitMs
- wait timeout in millisecondsreq
- request- Returns:
- generic response
- Throws:
Exception
-
setPermissions
@POST @Path("/{type}/{id}") GenericResponse setPermissions(@PathParam("type") String objType, @PathParam("id") int objId, @QueryParam("wait") @DefaultValue("0") long waitMs, SetPermsRequest req) throws Exception Set the permissions on the identified object according to the posted request- Parameters:
objType
- object typeobjId
- object idwaitMs
- wait timeout in millisecondsreq
- request- Returns:
- generic response
- Throws:
Exception
-
list
@GET @Path("/list/{type}") GroupsPermBitsResponse list(@PathParam("type") String objType) throws Exception 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)- Parameters:
objType
- Type of the object- Returns:
- generic GroupsPermBitsResponse object
- Throws:
Exception
-
list
@GET @Path("/list/{type}/{id}") GroupsPermBitsResponse list(@PathParam("type") String objType, @PathParam("id") int objId) throws Exception 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 objectobjId
- ID of the object- Returns:
- generic GroupsPermBitsResponse object
- Throws:
Exception
-