- Home
- Resources
- 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 |
GET /perm/{type}
Get the permission bits valid for the current user and the given type
Request Parameters
name |
type |
description |
default |
constraints |
type |
path |
object type |
|
|
map |
query |
true if the privileges should also be returned as map |
false |
boolean |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
PermBitsResponse
(JSON) |
permission bits response |
Example
Request
GET /perm/{type}
Content-Type: */*
Accept: application/json
...
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"perm" : "...",
"rolePerm" : "...",
"permissionsMap" : {
"permissions" : {
"property1" : true,
"property2" : true
},
"rolePermissions" : {
"page" : {
"property1" : true,
"property2" : true
},
"pageLanguages" : {
"property1" : { },
"property2" : { }
},
"file" : {
"property1" : true,
"property2" : true
}
}
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
POST /perm/{type}
Set the permissions on the type
Request Parameters
name |
type |
description |
default |
constraints |
type |
path |
type |
|
|
wait |
query |
wait timeout in milliseconds |
0 |
long |
Request Body
media type |
data type |
description |
application/json |
SetPermsRequest
(JSON) |
request |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
GenericResponse
(JSON) |
generic response |
Example
Request
POST /perm/{type}
Content-Type: application/json
Accept: application/json
{
"perm" : "...",
"groupId" : 12345,
"subGroups" : true,
"subObjects" : true,
"roleIds" : [ 12345, 12345 ]
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /perm/list/{type}
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)
Request Parameters
name |
type |
description |
type |
path |
Type of the object |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
GroupsPermBitsResponse
(JSON) |
generic GroupsPermBitsResponse object |
Example
Request
GET /perm/list/{type}
Content-Type: */*
Accept: application/json
...
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups" : {
"property1" : "...",
"property2" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /perm/{type}/{id}
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).
Request Parameters
name |
type |
description |
default |
constraints |
id |
path |
object id |
|
required int |
type |
path |
object type (10002 = Folder, 10001 = Node) |
|
|
lang |
query |
optional language id for which the role permissions should be returned |
0 |
int |
map |
query |
true if the privileges should also be returned as map |
false |
boolean |
nodeId |
query |
optional node id |
0 |
int |
type |
query |
optional type for which the role permission should be returned (10007 = Pages, 10008 = Files) |
-1 |
int |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
PermBitsResponse
(JSON) |
permission bits response |
Example
Request
GET /perm/{type}/{id}
Content-Type: */*
Accept: application/json
...
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"perm" : "...",
"rolePerm" : "...",
"permissionsMap" : {
"permissions" : {
"property1" : true,
"property2" : true
},
"rolePermissions" : {
"page" : {
"property1" : true,
"property2" : true
},
"pageLanguages" : {
"property1" : { },
"property2" : { }
},
"file" : {
"property1" : true,
"property2" : true
}
}
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
POST /perm/{type}/{id}
Set the permissions on the identified object according to the posted request
Request Parameters
name |
type |
description |
default |
constraints |
id |
path |
object id |
|
required int |
type |
path |
object type |
|
|
wait |
query |
wait timeout in milliseconds |
0 |
long |
Request Body
media type |
data type |
description |
application/json |
SetPermsRequest
(JSON) |
request |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
GenericResponse
(JSON) |
generic response |
Example
Request
POST /perm/{type}/{id}
Content-Type: application/json
Accept: application/json
{
"perm" : "...",
"groupId" : 12345,
"subGroups" : true,
"subObjects" : true,
"roleIds" : [ 12345, 12345 ]
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /perm/list/{type}/{id}
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)
Request Parameters
name |
type |
description |
constraints |
id |
path |
ID of the object |
required int |
type |
path |
Type of the object |
|
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
GroupsPermBitsResponse
(JSON) |
generic GroupsPermBitsResponse object |
Example
Request
GET /perm/list/{type}/{id}
Content-Type: */*
Accept: application/json
...
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups" : {
"property1" : "...",
"property2" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /perm/{perm}/{type}/{id}
Check whether the user has permission perm on the object defined by type and id
Request Parameters
name |
type |
description |
default |
constraints |
id |
path |
object id |
|
required int |
perm |
path |
permission |
|
"channelsync" or "create" or "createfolder" or "createform" or "createitems" or "createoverview" or "createtemplates" or "delete" or "deletefolder" or "deleteform" or "deleteitems" or "deletetemplates" or "edit" or "formreport" or "importitems" or "inheritance" or "linkoverview" or "linktemplates" or "publish" or "publishform" or "publishpages" or "read" or "readitems" or "readtemplates" or "setperm" or "translatepages" or "update" or "updateconstructs" or "updatefolder" or "updateform" or "updateinheritance" or "updateitems" or "updatetemplates" or "userassignment" or "view" or "viewform" or "wastebin" |
type |
path |
object type |
|
|
nodeId |
query |
node id |
0 |
int |
Response Codes
code |
condition |
401 |
No valid sid and session secret cookie were provided. |
403 |
User has insufficient permissions. |
Response Body
media type |
data type |
description |
application/json |
PermResponse
(JSON) |
response containing the result |
Example
Request
GET /perm/{perm}/{type}/{id}
Content-Type: */*
Accept: application/json
...
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"granted" : true,
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}