Skip to content

Commit cd92b35

Browse files
feat: add update_permissions function for capsules (#38)
1 parent 02a159c commit cd92b35

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/codeocean/capsule.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Optional, Iterator
66
from requests_toolbelt.sessions import BaseUrlSession
77

8-
from codeocean.components import Ownership, SortOrder, SearchFilter
8+
from codeocean.components import Ownership, SortOrder, SearchFilter, Permissions
99
from codeocean.computation import Computation
1010
from codeocean.data_asset import DataAssetAttachParams, DataAssetAttachResults
1111
from codeocean.enum import StrEnum
@@ -92,6 +92,12 @@ def list_computations(self, capsule_id: str) -> list[Computation]:
9292

9393
return [Computation.from_dict(c) for c in res.json()]
9494

95+
def update_permissions(self, capsule_id: str, permissions: Permissions):
96+
self.client.post(
97+
f"capsules/{capsule_id}/permissions",
98+
json=permissions.to_dict(),
99+
)
100+
95101
def attach_data_assets(
96102
self,
97103
capsule_id: str,

0 commit comments

Comments
 (0)