【问题标题】:AccessDeniedException: 403 does not have storage.buckets.get access to the Google Cloud Storage bucketAccessDeniedException: 403 没有 storage.buckets.get 访问 Google Cloud Storage 存储桶的权限
【发布时间】:2020-12-03 18:16:11
【问题描述】:
【问题讨论】:
标签:
firebase
google-cloud-storage
firebase-storage
gsutil
【解决方案1】:
此错误是因为通过 gsutil 命令验证的用户没有存储管理员角色,无法修改存储桶的 CORS 配置。
作为documentation guides you on installing the full cloud SDK,我假设你拥有它并且可以使用它上面的命令。
gcloud auth login
按照屏幕上的说明进行操作。
- 登录后,您需要在帐户中拥有存储管理员角色,为此您需要知道您的项目 ID,然后授予权限。所以需要运行以下两个命令:
gcloud projects list
gcloud projects add-iam-policy-binding <PROJECT-ID> --member='user:<USER_ACCOUNT>' --role='storage.admin'
您将从第一个命令中获得的项目 ID。
现在你应该可以运行了:
set cors.json gs://images/