atlassian-python-api 4.0.0__py3-none-any.whl → 4.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atlassian/VERSION +1 -1
- atlassian/bamboo.py +6 -4
- atlassian/bitbucket/__init__.py +7 -3
- atlassian/bitbucket/cloud/repositories/repositoryVariables.py +2 -3
- atlassian/confluence.py +264 -18
- atlassian/jira.py +841 -588
- atlassian/py.typed +0 -0
- atlassian/rest_client.py +406 -98
- atlassian/typehints.py +7 -0
- {atlassian_python_api-4.0.0.dist-info → atlassian_python_api-4.0.2.dist-info}/METADATA +2 -1
- {atlassian_python_api-4.0.0.dist-info → atlassian_python_api-4.0.2.dist-info}/RECORD +14 -12
- {atlassian_python_api-4.0.0.dist-info → atlassian_python_api-4.0.2.dist-info}/WHEEL +1 -1
- {atlassian_python_api-4.0.0.dist-info → atlassian_python_api-4.0.2.dist-info}/licenses/LICENSE +0 -0
- {atlassian_python_api-4.0.0.dist-info → atlassian_python_api-4.0.2.dist-info}/top_level.txt +0 -0
atlassian/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.
|
|
1
|
+
4.0.2
|
atlassian/bamboo.py
CHANGED
|
@@ -746,11 +746,13 @@ class Bamboo(AtlassianRestAPI):
|
|
|
746
746
|
return self.delete(self.resource_url(resource))
|
|
747
747
|
|
|
748
748
|
@property
|
|
749
|
-
def get_projects(self):
|
|
749
|
+
def get_projects(self, start=0, limit=25):
|
|
750
750
|
"""Method used to list all projects defined in Bamboo.
|
|
751
|
-
Projects without any plan are not listed.
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
Projects without any plan are not listed.
|
|
752
|
+
:return: GET request
|
|
753
|
+
"""
|
|
754
|
+
start_idx = start
|
|
755
|
+
max_results = limit
|
|
754
756
|
|
|
755
757
|
while True:
|
|
756
758
|
resource = f"project?start-index={start_idx}&max-result={max_results}"
|
atlassian/bitbucket/__init__.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
2
|
import logging
|
|
3
3
|
from enum import Enum
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from deprecated import deprecated
|
|
6
7
|
from requests import HTTPError
|
|
7
8
|
|
|
8
|
-
from .base import BitbucketBase
|
|
9
9
|
from atlassian.bitbucket.cloud import Cloud
|
|
10
10
|
|
|
11
|
+
from .base import BitbucketBase
|
|
12
|
+
|
|
11
13
|
log = logging.getLogger(__name__)
|
|
12
14
|
|
|
13
15
|
|
|
@@ -1891,7 +1893,7 @@ class Bitbucket(BitbucketBase):
|
|
|
1891
1893
|
|
|
1892
1894
|
def assign_pull_request_participant_role(
|
|
1893
1895
|
self, project_key: str, repository_slug: str, pull_request_id: int, role: str, user: str
|
|
1894
|
-
) -> dict:
|
|
1896
|
+
) -> Optional[dict]:
|
|
1895
1897
|
"""
|
|
1896
1898
|
Assign a role to a user for a pull request
|
|
1897
1899
|
:param project_key: The project key
|
|
@@ -2117,7 +2119,9 @@ class Bitbucket(BitbucketBase):
|
|
|
2117
2119
|
data = {"text": text, "severity": severity}
|
|
2118
2120
|
return self.post(url, data=data)
|
|
2119
2121
|
|
|
2120
|
-
def search_pull_request_blocker_comment(
|
|
2122
|
+
def search_pull_request_blocker_comment(
|
|
2123
|
+
self, project_key: str, repository_slug: str, pull_request_id: int
|
|
2124
|
+
) -> Optional[dict]:
|
|
2121
2125
|
"""
|
|
2122
2126
|
Get all comments that block the merge of a pull request
|
|
2123
2127
|
:param project_key: The project key
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
|
-
|
|
3
2
|
from ..base import BitbucketCloudBase
|
|
4
3
|
|
|
5
4
|
|
|
@@ -7,7 +6,7 @@ class RepositoryVariables(BitbucketCloudBase):
|
|
|
7
6
|
def __init__(self, url, *args, **kwargs):
|
|
8
7
|
super(RepositoryVariables, self).__init__(url, *args, **kwargs)
|
|
9
8
|
|
|
10
|
-
def __get_object(self, data):
|
|
9
|
+
def __get_object(self, data) -> "RepositoryVariable":
|
|
11
10
|
return RepositoryVariable(
|
|
12
11
|
self.url_joiner(self.url, data["uuid"]),
|
|
13
12
|
data,
|
|
@@ -61,7 +60,7 @@ class RepositoryVariables(BitbucketCloudBase):
|
|
|
61
60
|
|
|
62
61
|
return
|
|
63
62
|
|
|
64
|
-
def get(self, uuid):
|
|
63
|
+
def get(self, uuid: str): # type: ignore[override]
|
|
65
64
|
"""
|
|
66
65
|
Returns the pipeline with the uuid in this repository.
|
|
67
66
|
|
atlassian/confluence.py
CHANGED
|
@@ -5,13 +5,15 @@ import logging
|
|
|
5
5
|
import os
|
|
6
6
|
import re
|
|
7
7
|
import time
|
|
8
|
+
from typing import cast
|
|
8
9
|
|
|
10
|
+
import requests
|
|
9
11
|
from bs4 import BeautifulSoup
|
|
10
12
|
from deprecated import deprecated
|
|
11
|
-
import requests
|
|
12
13
|
from requests import HTTPError
|
|
13
14
|
|
|
14
15
|
from atlassian import utils
|
|
16
|
+
|
|
15
17
|
from .errors import (
|
|
16
18
|
ApiConflictError,
|
|
17
19
|
ApiError,
|
|
@@ -343,7 +345,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
343
345
|
try:
|
|
344
346
|
return response.get("results")[0]
|
|
345
347
|
except (IndexError, TypeError) as e:
|
|
346
|
-
log.error("Can't find '
|
|
348
|
+
log.error(f"Can't find '{title}' page on {self.url}")
|
|
347
349
|
log.debug(e)
|
|
348
350
|
return None
|
|
349
351
|
|
|
@@ -1468,7 +1470,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
1468
1470
|
downloaded_files = {}
|
|
1469
1471
|
for attachment in attachments:
|
|
1470
1472
|
file_name = attachment["title"] or attachment["id"] # Use attachment ID if title is unavailable
|
|
1471
|
-
download_link =
|
|
1473
|
+
download_link = attachment["_links"]["download"]
|
|
1472
1474
|
# Fetch the file content
|
|
1473
1475
|
response = self.get(str(download_link), not_json_response=True)
|
|
1474
1476
|
|
|
@@ -1644,7 +1646,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
1644
1646
|
|
|
1645
1647
|
return response
|
|
1646
1648
|
|
|
1647
|
-
def remove_page_label(self, page_id, label):
|
|
1649
|
+
def remove_page_label(self, page_id: str, label: str):
|
|
1648
1650
|
"""
|
|
1649
1651
|
Delete Confluence page label
|
|
1650
1652
|
:param page_id: content_id format
|
|
@@ -1803,7 +1805,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
1803
1805
|
log.debug('Old Content: """%s"""', confluence_body_content)
|
|
1804
1806
|
log.debug('New Content: """%s"""', body)
|
|
1805
1807
|
|
|
1806
|
-
if confluence_body_content.strip() == body.strip():
|
|
1808
|
+
if confluence_body_content.strip().lower() == body.strip().lower():
|
|
1807
1809
|
log.info("Content of %s is exactly the same", page_id)
|
|
1808
1810
|
return True
|
|
1809
1811
|
else:
|
|
@@ -2423,7 +2425,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
2423
2425
|
else:
|
|
2424
2426
|
members.extend(values)
|
|
2425
2427
|
if not members:
|
|
2426
|
-
print(
|
|
2428
|
+
print(f"Did not get members from {group_name} group, please check permissions or connectivity")
|
|
2427
2429
|
return members
|
|
2428
2430
|
|
|
2429
2431
|
def get_space(self, space_key, expand="description.plain,homepage", params=None):
|
|
@@ -2709,7 +2711,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
2709
2711
|
"""
|
|
2710
2712
|
headers = self.form_token_headers
|
|
2711
2713
|
url = f"spaces/flyingpdf/pdfpageexport.action?pageId={page_id}"
|
|
2712
|
-
if self.api_version == "cloud":
|
|
2714
|
+
if self.api_version == "cloud" or self.cloud:
|
|
2713
2715
|
url = self.get_pdf_download_url_for_confluence_cloud(url)
|
|
2714
2716
|
if not url:
|
|
2715
2717
|
log.error("Failed to get download PDF url.")
|
|
@@ -2740,13 +2742,13 @@ class Confluence(AtlassianRestAPI):
|
|
|
2740
2742
|
:return: The URL to download the exported file.
|
|
2741
2743
|
"""
|
|
2742
2744
|
|
|
2743
|
-
def get_atl_request(
|
|
2745
|
+
def get_atl_request(link: str):
|
|
2744
2746
|
# Nested function used to get atl_token used for XSRF protection.
|
|
2745
2747
|
# This is only applicable to html/csv/xml space exports
|
|
2746
2748
|
try:
|
|
2747
|
-
response = self.get(
|
|
2749
|
+
response = self.get(link, advanced_mode=True)
|
|
2748
2750
|
parsed_html = BeautifulSoup(response.text, "html.parser")
|
|
2749
|
-
atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value")
|
|
2751
|
+
atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value") # type: ignore[union-attr]
|
|
2750
2752
|
return atl_token
|
|
2751
2753
|
except Exception as e:
|
|
2752
2754
|
raise ApiError("Problems with getting the atl_token for get_space_export method :", reason=e)
|
|
@@ -2798,17 +2800,17 @@ class Confluence(AtlassianRestAPI):
|
|
|
2798
2800
|
parsed_html = BeautifulSoup(response.text, "html.parser")
|
|
2799
2801
|
# Getting the poll URL to get the export progress status
|
|
2800
2802
|
try:
|
|
2801
|
-
poll_url = parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content")
|
|
2803
|
+
poll_url = cast("str", parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content")) # type: ignore[union-attr]
|
|
2802
2804
|
except Exception as e:
|
|
2803
2805
|
raise ApiError("Problems with getting the poll_url for get_space_export method :", reason=e)
|
|
2804
2806
|
running_task = True
|
|
2805
2807
|
while running_task:
|
|
2806
2808
|
try:
|
|
2807
|
-
progress_response = self.get(poll_url)
|
|
2808
|
-
log.info("Space
|
|
2809
|
-
if progress_response
|
|
2810
|
-
parsed_html = BeautifulSoup(progress_response
|
|
2811
|
-
download_url = parsed_html.find("a", {"class": "space-export-download-path"}).get("href")
|
|
2809
|
+
progress_response = self.get(poll_url) or {}
|
|
2810
|
+
log.info(f"Space {space_key} export status: {progress_response.get('message', 'None')}")
|
|
2811
|
+
if progress_response is not {} and progress_response.get("complete"):
|
|
2812
|
+
parsed_html = BeautifulSoup(progress_response.get("message"), "html.parser")
|
|
2813
|
+
download_url = cast("str", parsed_html.find("a", {"class": "space-export-download-path"}).get("href")) # type: ignore
|
|
2812
2814
|
if self.url in download_url:
|
|
2813
2815
|
return download_url
|
|
2814
2816
|
else:
|
|
@@ -3313,6 +3315,250 @@ class Confluence(AtlassianRestAPI):
|
|
|
3313
3315
|
url = "rest/api/user/%s/group/%s" % (username, group_name)
|
|
3314
3316
|
return self.put(url)
|
|
3315
3317
|
|
|
3318
|
+
# Space Permissions
|
|
3319
|
+
def get_all_space_permissions(self, space_key):
|
|
3320
|
+
"""
|
|
3321
|
+
Returns list of permissions granted to users and groups in the particular space.
|
|
3322
|
+
:param space_key:
|
|
3323
|
+
:return:
|
|
3324
|
+
"""
|
|
3325
|
+
url = f"rest/api/space/{space_key}/permissions"
|
|
3326
|
+
return self.get(url)
|
|
3327
|
+
|
|
3328
|
+
def set_permissions_to_multiple_items_for_space(self, space_key, user_key=None, group_name=None, operations=None):
|
|
3329
|
+
"""
|
|
3330
|
+
Sets permissions to multiple users/groups in the given space.
|
|
3331
|
+
Request should contain all permissions that user/group/anonymous user will have in a given space.
|
|
3332
|
+
If permission is absent in the request, but was granted before, it will be revoked.
|
|
3333
|
+
If empty list of permissions passed to user/group/anonymous user,
|
|
3334
|
+
then all their existing permissions will be revoked.
|
|
3335
|
+
If user/group/anonymous user not mentioned in the request, their permissions will not be revoked.
|
|
3336
|
+
|
|
3337
|
+
Maximum 40 different users/groups/anonymous user could be passed in the request.
|
|
3338
|
+
:param space_key:
|
|
3339
|
+
:param user_key:
|
|
3340
|
+
:param group_name:
|
|
3341
|
+
:param operations:
|
|
3342
|
+
:return:
|
|
3343
|
+
"""
|
|
3344
|
+
url = f"rest/api/space/{space_key}/permissions"
|
|
3345
|
+
params = []
|
|
3346
|
+
|
|
3347
|
+
if user_key:
|
|
3348
|
+
params.append({"userKey": user_key, "operations": operations or []})
|
|
3349
|
+
|
|
3350
|
+
if group_name:
|
|
3351
|
+
params.append({"groupName": group_name, "operations": operations or []})
|
|
3352
|
+
|
|
3353
|
+
if not user_key and not group_name:
|
|
3354
|
+
params.append({"operations": operations or []})
|
|
3355
|
+
payload_json = json.dumps(params)
|
|
3356
|
+
return self.post(url, data=payload_json)
|
|
3357
|
+
|
|
3358
|
+
def get_permissions_granted_to_anonymous_for_space(self, space_key):
|
|
3359
|
+
"""
|
|
3360
|
+
Get permissions granted to anonymous user for the given space
|
|
3361
|
+
:param space_key:
|
|
3362
|
+
:return:
|
|
3363
|
+
"""
|
|
3364
|
+
url = f"rest/api/space/{space_key}/permissions/anonymous"
|
|
3365
|
+
return self.get(url)
|
|
3366
|
+
|
|
3367
|
+
def set_permissions_to_anonymous_for_space(self, space_key, operations=None):
|
|
3368
|
+
"""
|
|
3369
|
+
Grant permissions to anonymous user in the given space. Operation doesn't override existing permissions,
|
|
3370
|
+
will only add those one that weren't granted before. Multiple permissions could be passed in one request.
|
|
3371
|
+
Supported targetType and operationKey pairs:
|
|
3372
|
+
|
|
3373
|
+
space read
|
|
3374
|
+
space administer
|
|
3375
|
+
space export
|
|
3376
|
+
space restrict
|
|
3377
|
+
space delete_own
|
|
3378
|
+
space delete_mail
|
|
3379
|
+
page create
|
|
3380
|
+
page delete
|
|
3381
|
+
blogpost create
|
|
3382
|
+
blogpost delete
|
|
3383
|
+
comment create
|
|
3384
|
+
comment delete
|
|
3385
|
+
attachment create
|
|
3386
|
+
attachment delete
|
|
3387
|
+
:param space_key:
|
|
3388
|
+
:param operations:
|
|
3389
|
+
:return:
|
|
3390
|
+
"""
|
|
3391
|
+
url = f"rest/api/space/{space_key}/permissions/anonymous"
|
|
3392
|
+
data = {"operations": operations or []}
|
|
3393
|
+
return self.put(url, data=data)
|
|
3394
|
+
|
|
3395
|
+
def remove_permissions_from_anonymous_for_space(self, space_key, operations=None):
|
|
3396
|
+
"""
|
|
3397
|
+
Revoke permissions from anonymous user in the given space.
|
|
3398
|
+
If anonymous user doesn't have permissions that we are trying to revoke,
|
|
3399
|
+
those permissions will be silently skipped. Multiple permissions could be passed in one request.
|
|
3400
|
+
Supported targetType and operationKey pairs:
|
|
3401
|
+
|
|
3402
|
+
space read
|
|
3403
|
+
space administer
|
|
3404
|
+
space export
|
|
3405
|
+
space restrict
|
|
3406
|
+
space delete_own
|
|
3407
|
+
space delete_mail
|
|
3408
|
+
page create
|
|
3409
|
+
page delete
|
|
3410
|
+
blogpost create
|
|
3411
|
+
blogpost delete
|
|
3412
|
+
comment create
|
|
3413
|
+
comment delete
|
|
3414
|
+
attachment create
|
|
3415
|
+
attachment delete
|
|
3416
|
+
:param space_key:
|
|
3417
|
+
:param operations:
|
|
3418
|
+
:return:
|
|
3419
|
+
"""
|
|
3420
|
+
url = f"rest/api/space/{space_key}/permissions/anonymous/revoke"
|
|
3421
|
+
data = {"operations": operations or []}
|
|
3422
|
+
return self.put(url, data=data)
|
|
3423
|
+
|
|
3424
|
+
def get_permissions_granted_to_group_for_space(self, space_key, group_name):
|
|
3425
|
+
"""
|
|
3426
|
+
Get permissions granted to group for the given space
|
|
3427
|
+
:param space_key:
|
|
3428
|
+
:param group_name:
|
|
3429
|
+
:return:
|
|
3430
|
+
"""
|
|
3431
|
+
url = f"rest/api/space/{space_key}/permissions/group/{group_name}"
|
|
3432
|
+
return self.get(url)
|
|
3433
|
+
|
|
3434
|
+
def set_permissions_to_group_for_space(self, space_key, group_name, operations=None):
|
|
3435
|
+
"""
|
|
3436
|
+
Grant permissions to group in the given space.
|
|
3437
|
+
Operation doesn't override existing permissions, will only add those one that weren't granted before.
|
|
3438
|
+
Multiple permissions could be passed in one request. Supported targetType and operationKey pairs:
|
|
3439
|
+
|
|
3440
|
+
space read
|
|
3441
|
+
space administer
|
|
3442
|
+
space export
|
|
3443
|
+
space restrict
|
|
3444
|
+
space delete_own
|
|
3445
|
+
space delete_mail
|
|
3446
|
+
page create
|
|
3447
|
+
page delete
|
|
3448
|
+
blogpost create
|
|
3449
|
+
blogpost delete
|
|
3450
|
+
comment create
|
|
3451
|
+
comment delete
|
|
3452
|
+
attachment create
|
|
3453
|
+
attachment delete
|
|
3454
|
+
:param space_key:
|
|
3455
|
+
:param group_name:
|
|
3456
|
+
:param operations:
|
|
3457
|
+
:return:
|
|
3458
|
+
"""
|
|
3459
|
+
url = f"rest/api/space/{space_key}/permissions/group/{group_name}"
|
|
3460
|
+
data = {"operations": operations or []}
|
|
3461
|
+
return self.put(url, data=data)
|
|
3462
|
+
|
|
3463
|
+
def remove_permissions_from_group_for_space(self, space_key, group_name, operations=None):
|
|
3464
|
+
"""
|
|
3465
|
+
Revoke permissions from a group in the given space.
|
|
3466
|
+
If group doesn't have permissions that we are trying to revoke,
|
|
3467
|
+
those permissions will be silently skipped. Multiple permissions could be passed in one request.
|
|
3468
|
+
Supported targetType and operationKey pairs:
|
|
3469
|
+
|
|
3470
|
+
space read
|
|
3471
|
+
space administer
|
|
3472
|
+
space export
|
|
3473
|
+
space restrict
|
|
3474
|
+
space delete_own
|
|
3475
|
+
space delete_mail
|
|
3476
|
+
page create
|
|
3477
|
+
page delete
|
|
3478
|
+
blogpost create
|
|
3479
|
+
blogpost delete
|
|
3480
|
+
comment create
|
|
3481
|
+
comment delete
|
|
3482
|
+
attachment create
|
|
3483
|
+
attachment delete
|
|
3484
|
+
:param space_key:
|
|
3485
|
+
:param group_name:
|
|
3486
|
+
:param operations:
|
|
3487
|
+
:return:
|
|
3488
|
+
"""
|
|
3489
|
+
url = f"rest/api/space/{space_key}/permissions/group/{group_name}/revoke"
|
|
3490
|
+
data = {"operations": operations or []}
|
|
3491
|
+
return self.put(url, data=data)
|
|
3492
|
+
|
|
3493
|
+
def get_permissions_granted_to_user_for_space(self, space_key, user_key):
|
|
3494
|
+
"""
|
|
3495
|
+
Get permissions granted to user for the given space
|
|
3496
|
+
:param space_key:
|
|
3497
|
+
:param user_key:
|
|
3498
|
+
:return:
|
|
3499
|
+
"""
|
|
3500
|
+
url = f"rest/api/space/{space_key}/permissions/user/{user_key}"
|
|
3501
|
+
return self.get(url)
|
|
3502
|
+
|
|
3503
|
+
def set_permissions_to_user_for_space(self, space_key, user_key, operations=None):
|
|
3504
|
+
"""
|
|
3505
|
+
Grant permissions to user in the given space.
|
|
3506
|
+
Operation doesn't override existing permissions, will only add those one that weren't granted before.
|
|
3507
|
+
Multiple permissions could be passed in one request. Supported targetType and operationKey pairs:
|
|
3508
|
+
|
|
3509
|
+
space read
|
|
3510
|
+
space administer
|
|
3511
|
+
space export
|
|
3512
|
+
space restrict
|
|
3513
|
+
space delete_own
|
|
3514
|
+
space delete_mail
|
|
3515
|
+
page create
|
|
3516
|
+
page delete
|
|
3517
|
+
blogpost create
|
|
3518
|
+
blogpost delete
|
|
3519
|
+
comment create
|
|
3520
|
+
comment delete
|
|
3521
|
+
attachment create
|
|
3522
|
+
attachment delete
|
|
3523
|
+
:param space_key:
|
|
3524
|
+
:param user_key:
|
|
3525
|
+
:param operations:
|
|
3526
|
+
:return:
|
|
3527
|
+
"""
|
|
3528
|
+
url = f"rest/api/space/{space_key}/permissions/user/{user_key}"
|
|
3529
|
+
data = {"operations": operations or []}
|
|
3530
|
+
return self.put(url, data=data)
|
|
3531
|
+
|
|
3532
|
+
def remove_permissions_from_user_for_space(self, space_key, user_key, operations=None):
|
|
3533
|
+
"""
|
|
3534
|
+
Revoke permissions from a user in the given space.
|
|
3535
|
+
If user doesn't have permissions that we are trying to revoke,
|
|
3536
|
+
those permissions will be silently skipped. Multiple permissions could be passed in one request.
|
|
3537
|
+
Supported targetType and operationKey pairs:
|
|
3538
|
+
|
|
3539
|
+
space read
|
|
3540
|
+
space administer
|
|
3541
|
+
space export
|
|
3542
|
+
space restrict
|
|
3543
|
+
space delete_own
|
|
3544
|
+
space delete_mail
|
|
3545
|
+
page create
|
|
3546
|
+
page delete
|
|
3547
|
+
blogpost create
|
|
3548
|
+
blogpost delete
|
|
3549
|
+
comment create
|
|
3550
|
+
comment delete
|
|
3551
|
+
attachment create
|
|
3552
|
+
attachment delete
|
|
3553
|
+
:param space_key:
|
|
3554
|
+
:param user_key:
|
|
3555
|
+
:param operations:
|
|
3556
|
+
:return:
|
|
3557
|
+
"""
|
|
3558
|
+
url = f"rest/api/space/{space_key}/permissions/user/{user_key}/revoke"
|
|
3559
|
+
data = {"operations": operations or []}
|
|
3560
|
+
return self.put(url, params=data)
|
|
3561
|
+
|
|
3316
3562
|
def add_space_permissions(
|
|
3317
3563
|
self,
|
|
3318
3564
|
space_key,
|
|
@@ -3347,7 +3593,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
3347
3593
|
To learn more about how to use these APIs,
|
|
3348
3594
|
please refer to the Confluence JSON-RPC documentation on Atlassian Developers.
|
|
3349
3595
|
"""
|
|
3350
|
-
if self.api_version == "cloud":
|
|
3596
|
+
if self.api_version == "cloud" or self.cloud:
|
|
3351
3597
|
return {}
|
|
3352
3598
|
url = "rpc/json-rpc/confluenceservice-v2"
|
|
3353
3599
|
data = {
|
|
@@ -3365,7 +3611,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
3365
3611
|
To learn more about how to use these APIs,
|
|
3366
3612
|
please refer to the Confluence JSON-RPC documentation on Atlassian Developers.
|
|
3367
3613
|
"""
|
|
3368
|
-
if self.api_version == "cloud":
|
|
3614
|
+
if self.api_version == "cloud" or self.cloud:
|
|
3369
3615
|
return self.get_space(space_key=space_key, expand="permissions")
|
|
3370
3616
|
url = "rpc/json-rpc/confluenceservice-v2"
|
|
3371
3617
|
data = {
|