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 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).
name | type | description | default | constraints |
---|---|---|---|---|
id | path | object id | int | |
type | path | object type (10002 = Folder, 10001 = Node) | int | |
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 |
media type | data type | description |
---|---|---|
application/json | PermBitsResponse (JSON) | permission bits response |
GET /perm/{type}/{id} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"perm" : "...",
"rolePerm" : "...",
"privilegeMap" : {
"privileges" : {
"property1" : true,
"property2" : true
},
"languages" : [ {
"language" : { },
"privileges" : {
"property1" : true,
"property2" : true
}
}, {
"language" : { },
"privileges" : {
"property1" : true,
"property2" : true
}
} ]
},
"messages" : [ {
"fieldName" : "...",
"message" : "...",
"type" : "NEUTRAL",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
}, {
"fieldName" : "...",
"message" : "...",
"type" : "CRITICAL",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
} ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
Check whether the user has permission perm on the object defined by type and id
name | type | description | default | constraints |
---|---|---|---|---|
id | path | object id | int | |
perm | path | permission | "create" or "delete" or "edit" or "publish" or "view" | |
type | path | object type | int | |
nodeId | query | node id | 0 | int |
media type | data type | description |
---|---|---|
application/json | PermResponse (JSON) | response containing the result |
GET /perm/{perm}/{type}/{id} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"granted" : true,
"messages" : [ {
"fieldName" : "...",
"message" : "...",
"type" : "INFO",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
}, {
"fieldName" : "...",
"message" : "...",
"type" : "INFO",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
} ],
"responseInfo" : {
"responseCode" : "NOTFOUND",
"responseMessage" : "...",
"property" : "..."
}
}
Set the permissions on the identified object according to the posted request
name | type | description | constraints |
---|---|---|---|
id | path | object id | int |
type | path | object type | int |
media type | data type | description |
---|---|---|
application/json | SetPermsRequest (JSON) | request |
media type | data type | description |
---|---|---|
application/json | GenericResponse (JSON) | generic response |
POST /perm/{type}/{id}
Content-Type: application/json
Accept: application/json
{
"perm" : "...",
"groupId" : 12345,
"subGroups" : true,
"subObjects" : true,
"roleIds" : [ 12345, 12345 ]
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"messages" : [ {
"fieldName" : "...",
"message" : "...",
"type" : "NEUTRAL",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
}, {
"fieldName" : "...",
"message" : "...",
"type" : "INFO",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
} ],
"responseInfo" : {
"responseCode" : "PERMISSION",
"responseMessage" : "...",
"property" : "..."
}
}
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)
name | type | description | constraints |
---|---|---|---|
type | path | Type of the object | int |
media type | data type | description |
---|---|---|
application/json | GroupsPermBitsResponse (JSON) | generic GroupsPermBitsResponse object |
GET /perm/list/{type} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups" : {
"property1" : "...",
"property2" : "..."
},
"messages" : [ {
"fieldName" : "...",
"message" : "...",
"type" : "CRITICAL",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
}, {
"fieldName" : "...",
"message" : "...",
"type" : "SUCCESS",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
} ],
"responseInfo" : {
"responseCode" : "FAILURE",
"responseMessage" : "...",
"property" : "..."
}
}
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)
name | type | description | constraints |
---|---|---|---|
id | path | ID of the object | int |
type | path | Type of the object | int |
media type | data type | description |
---|---|---|
application/json | GroupsPermBitsResponse (JSON) | generic GroupsPermBitsResponse object |
GET /perm/list/{type}/{id} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups" : {
"property1" : "...",
"property2" : "..."
},
"messages" : [ {
"fieldName" : "...",
"message" : "...",
"type" : "NEUTRAL",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
}, {
"fieldName" : "...",
"message" : "...",
"type" : "INFO",
"timestamp" : 12345,
"image" : "...",
"sender" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ { }, { } ],
"login" : "...",
"password" : "..."
},
"id" : 12345
} ],
"responseInfo" : {
"responseCode" : "FAILURE",
"responseMessage" : "...",
"property" : "..."
}
}