gpt4 book ai didi

perl - 编辑 Google Storage 对象元数据需要哪些权限?

转载 作者:行者123 更新时间:2023-12-02 14:56:24 27 4
gpt4 key购买 nike

我有以下 Perl 代码:

  $response = $process->request('PATCH',
"https://www.googleapis.com/storage/v1/b/$Bucket/o/$EscapedName",
'{"content-type": "image/jpeg"}',
# '{"metadata": {"Content-Type": "image/jpeg"}}',
{'Content-Type' => 'application/json'});
unless ($response->is_success) {
print "Content-Type: text/plain\n\n";
print $response->status_line . "\n" . $response->decoded_content . "\n" ;
exit;
}

产生

403 Forbidden
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}

尽管我有:

  • 存储管理员
  • 存储对象管理员
  • 存储对象创建者
  • 存储对象查看器

为我的用户启用。

为什么不起作用?

简单上传对象确实有效,但我无法设置此元数据。

最佳答案

要更新对象元数据,需要 storage.objects.update 权限。来自 Cloud Storage IAM Permissions :

Object permissions

...

storage.objects.update    Update object metadata, excluding ACLs.

但是 roles/storage.objectAdminroles/storage.admin 角色(假设这就是您列出的角色的意思)应该 已经包含该许可,因此可能有其他因素在起作用。来自 Standard roles :

roles/storage.objectAdmin  Full control over objects, including listing,    storage.objects.*
creating, viewing, and deleting objects.
Does not grant permission to read or edit
bucket metadata.
roles/storage.admin Full control of buckets and objects. storage.buckets.*
When applied to an individual bucket, control storage.objects.*
only to the specified bucket and objects within
the bucket.

关于perl - 编辑 Google Storage 对象元数据需要哪些权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52692119/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com