Google Cloud Storage存储桶->存在给出403

时间:2019-11-01 16:29:51

标签: php google-cloud-platform google-cloud-storage

我正在尝试检查Laravel PHP中是否存在存储桶。 我在exist()方法上收到403。为什么?

请参见第160行https://github.com/googleapis/google-cloud-php/blob/master/Storage/src/Bucket.php

class Person
  attr_accessor :name, :car
end

class Car
  attr_accessor :maker
end

1 个答案:

答案 0 :(得分:1)

您的服务帐户没有storage.buckets.get权限。为了检查存储桶是否存在然后创建它,请将roles/storage.admin分配给您的服务帐户。

有关参考,请参阅: