Difference between revisions of "Gsutil acl ch"
Jump to navigation
Jump to search
(35 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
− | < | + | <code>[[gsutil acl]] ch</code> |
− | + | * https://cloud.google.com/storage/docs/gsutil/commands/acl | |
− | === | + | |
+ | == Entities == | ||
+ | There are four different entity types: <code>[[Users]] (-u), [[Groups]] (-g), [[All Authenticated Users]] (AllAuthenticatedUsers or allauth)</code>, and <code>[[All Users]] (AllUsers or all)</code>. | ||
+ | |||
+ | Notes: | ||
+ | * [[Google Cloud Service account|Service Accounts]] are considered to be users | ||
+ | * Permissions: <code>R, W, O</code> | ||
+ | |||
+ | Options: | ||
+ | * <code>-R, -r</code> Performs "acl set" request recursively, to all objects under the specified URL. | ||
+ | * <code>-d, -f, -g, -p, -u </code> | ||
+ | |||
+ | == Examples == | ||
* <code>gsutil acl ch -u AllUsers:R gs://example-bucket/example-object</code> | * <code>gsutil acl ch -u AllUsers:R gs://example-bucket/example-object</code> | ||
Grant anyone on the internet WRITE access to the bucket example-bucket: | Grant anyone on the internet WRITE access to the bucket example-bucket: | ||
− | * <code> gsutil acl ch -u | + | * <code>gsutil acl ch -u [email protected]:WRITE gs://example-bucket</code> |
+ | |||
+ | Grant the group OWNER access to all jpg files in example-bucket: | ||
+ | |||
+ | * <code>gsutil acl ch -g [email protected]:O gs://example-bucket/**.jpg</code> | ||
+ | |||
+ | Remove access to the bucket example-bucket for the viewers of project number 12345: | ||
+ | |||
+ | * <code>gsutil acl ch -d viewers-12345 gs://example-bucket</code> | ||
+ | |||
+ | Grant all users from the G Suite domain my-domain.org READ access to the bucket gcs.my-domain.org: | ||
+ | |||
+ | * <code>gsutil acl ch -g my-domain.org:R gs://gcs.my-domain.org</code> | ||
+ | |||
+ | Remove any current access by [email protected] from the bucket example-bucket: | ||
+ | |||
+ | * <code>gsutil acl ch -d [email protected] gs://example-bucket</code> | ||
+ | |||
+ | === Ch Roles === | ||
+ | |||
+ | *<code>R: READ</code> | ||
+ | *<code>W: WRITE</code> | ||
+ | *<code>O: OWNER</code> | ||
== See also == | == See also == |
Latest revision as of 07:10, 19 September 2022
gsutil acl ch
Contents
Entities[edit]
There are four different entity types: Users (-u), Groups (-g), All Authenticated Users (AllAuthenticatedUsers or allauth)
, and All Users (AllUsers or all)
.
Notes:
- Service Accounts are considered to be users
- Permissions:
R, W, O
Options:
-R, -r
Performs "acl set" request recursively, to all objects under the specified URL.-d, -f, -g, -p, -u
Examples[edit]
gsutil acl ch -u AllUsers:R gs://example-bucket/example-object
Grant anyone on the internet WRITE access to the bucket example-bucket:
gsutil acl ch -u [email protected]:WRITE gs://example-bucket
Grant the group OWNER access to all jpg files in example-bucket:
gsutil acl ch -g [email protected]:O gs://example-bucket/**.jpg
Remove access to the bucket example-bucket for the viewers of project number 12345:
gsutil acl ch -d viewers-12345 gs://example-bucket
Grant all users from the G Suite domain my-domain.org READ access to the bucket gcs.my-domain.org:
gsutil acl ch -g my-domain.org:R gs://gcs.my-domain.org
Remove any current access by [email protected] from the bucket example-bucket:
gsutil acl ch -d [email protected] gs://example-bucket
Ch Roles[edit]
R: READ
W: WRITE
O: OWNER
See also[edit]
Advertising: