diff --git a/CHANGELOG.D/2414.bugfix b/CHANGELOG.D/2414.bugfix new file mode 100644 index 000000000..6600daea2 --- /dev/null +++ b/CHANGELOG.D/2414.bugfix @@ -0,0 +1 @@ +Fix sharing buckets using `neuro acl grant`. diff --git a/neuro-cli/src/neuro_cli/utils.py b/neuro-cli/src/neuro_cli/utils.py index a4cb5d61c..fdd23818e 100644 --- a/neuro-cli/src/neuro_cli/utils.py +++ b/neuro-cli/src/neuro_cli/utils.py @@ -538,9 +538,13 @@ def parse_resource_for_sharing(uri: str, root: Root) -> URL: if uri_res.scheme == "image" and ":" in uri_res.path: raise ValueError("tag is not allowed") - # URI's for object storage can only operate on bucket level - if uri_res.scheme == "blob" and "/" in uri_res.path.strip("/"): - raise ValueError("Only bucket level permissions are supported for Blob Storage") + if uri_res.scheme == "blob": + # Lets check that this is bucket url, not object in bucket + res = root.client.parse.split_blob_uri(uri_res) + if res.key: + raise ValueError( + "Only bucket level permissions are supported for Blob Storage" + ) return uri_res