From 80ded3cef1eec612146ecca29bab1ba1f799c961 Mon Sep 17 00:00:00 2001 From: neyrat-salvator Date: Tue, 15 Jul 2025 16:43:57 +0300 Subject: [PATCH] Update confluence/__init__.py with add space permissions Previously, there was a great lack of a method for adding space permissions to a space --- atlassian/confluence/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/atlassian/confluence/__init__.py b/atlassian/confluence/__init__.py index 8d4db1399..71acd201a 100644 --- a/atlassian/confluence/__init__.py +++ b/atlassian/confluence/__init__.py @@ -3698,6 +3698,24 @@ def add_space_permissions( return self.post(url, data=data, headers=self.experimental_headers) + def add_space_permission_json_rpc(self, space_key, user, permission): + """ + The JSON-RPC APIs for Confluence are provided here to help you browse and discover APIs you have access to. + JSON-RPC APIs operate differently than REST APIs. + To learn more about how to use these APIs, + please refer to the Confluence JSON-RPC documentation on Atlassian Developers. + """ + if self.api_version == "cloud" or self.cloud: + return {} + url = "rpc/json-rpc/confluenceservice-v2" + data = { + "jsonrpc": "2.0", + "method": "addPermissionToSpace", + "id": 9, + "params": [permission, user, space_key], + } + return self.post(url, data=data).get("result") or {} + def remove_space_permission(self, space_key, user, permission): """ The JSON-RPC APIs for Confluence are provided here to help you browse and discover APIs you have access to.