Skip to content

Commit 7f98667

Browse files
Update confluence/__init__.py with add space permissions (#1557)
Previously, there was a great lack of a method for adding space permissions to a space
1 parent 1caf67b commit 7f98667

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

atlassian/confluence/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,6 +3698,24 @@ def add_space_permissions(
36983698

36993699
return self.post(url, data=data, headers=self.experimental_headers)
37003700

3701+
def add_space_permission_json_rpc(self, space_key, user, permission):
3702+
"""
3703+
The JSON-RPC APIs for Confluence are provided here to help you browse and discover APIs you have access to.
3704+
JSON-RPC APIs operate differently than REST APIs.
3705+
To learn more about how to use these APIs,
3706+
please refer to the Confluence JSON-RPC documentation on Atlassian Developers.
3707+
"""
3708+
if self.api_version == "cloud" or self.cloud:
3709+
return {}
3710+
url = "rpc/json-rpc/confluenceservice-v2"
3711+
data = {
3712+
"jsonrpc": "2.0",
3713+
"method": "addPermissionToSpace",
3714+
"id": 9,
3715+
"params": [permission, user, space_key],
3716+
}
3717+
return self.post(url, data=data).get("result") or {}
3718+
37013719
def remove_space_permission(self, space_key, user, permission):
37023720
"""
37033721
The JSON-RPC APIs for Confluence are provided here to help you browse and discover APIs you have access to.

0 commit comments

Comments
 (0)