Adds new permission to space.
If the permission to be added is a group permission, the group can be identified by its group name or group id.
Note: Apps cannot access this REST resource - including when utilizing user impersonation.
Permissions required: 'Admin' permission for the space.
read:space.permission:confluence
, write:space.permission:confluence
Connect apps cannot access this REST resource.
string
RequiredThe permission to be created.
PermissionSubject
Requiredobject
RequiredGenericLinks
any
Returned if the requested content is returned.
This object represents a single space permission. Permissions consist of at least one operation object with an accompanying subjects object.
The following combinations of operation.key
and operation.target
values are
valid for the operation
object:
1 2 3 4 5 6 7
'create': 'page', 'blogpost', 'comment', 'attachment' 'read': 'space' 'delete': 'page', 'blogpost', 'comment', 'attachment', 'space' 'export': 'space' 'administer': 'space' 'archive': 'page' 'restrict_content': 'space'
For example, to enable Delete Own permission, set the operation
object to the following:
1 2 3 4
"operation": { "key": "delete", "target": "space" }
To enable Add/Delete Restrictions permissions, set the operation
object to the following:
1 2 3 4
"operation": { "key": "restrict_content", "target": "space" }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"subject": {
"type": "user",
"identifier": "<string>"
},
"operation": {
"key": "administer",
"target": "page"
},
"_links": {}
}`;
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
{
"id": 2154,
"subject": {
"type": "user",
"identifier": "<string>"
},
"operation": {
"key": "administer",
"target": "page"
},
"_links": {}
}
Adds new custom content permission to space.
If the permission to be added is a group permission, the group can be identified by its group name or group id.
Note: Only apps can access this REST resource and only make changes to the respective app permissions.
Permissions required: 'Admin' permission for the space.
read:space.permission:confluence
, write:space.permission:confluence
Connect app scope required: WRITE
string
RequiredThe permissions to be created.
PermissionSubject
Requiredarray<object>
RequiredReturned if the requested content is returned.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"subject": {
"type": "user",
"identifier": "<string>"
},
"operations": [
{
"key": "read",
"target": "<string>",
"access": true
}
]
}`;
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission/custom-content`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Removes a space permission. Note that removing Read Space permission for a user or group will remove all the space permissions for that user or group.
Note: Apps cannot access this REST resource - including when utilizing user impersonation.
Permissions required: 'Admin' permission for the space.
write:space.permission:confluence
Connect apps cannot access this REST resource.
string
Requiredinteger
RequiredPermission successfully removed.
1
2
3
4
5
6
7
8
9
10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/space/{spaceKey}/permission/{id}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Rate this page: