Google云端存储-权限不足 [英] Google Cloud Storage - insufficient permission

查看:104
本文介绍了Google云端存储-权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题似乎与另一篇文章相似,但对我来说却有所不同.因为我检查了 testIamPermission ,并且返回结果显示我已获得所需的所有权限,但仍收到权限不足.

The issue seems similar to another post, but It's different for me. Because I check the testIamPermission, and the returns showed that I got all permission I needed and still receive insufficient permission.

这是我收到的:

{'storage.buckets.get' : true}
{'storage.buckets.getIamPolicy' : true}
{'storage.objects.create' : true}
{'storage.objects.delete' : true}
{'storage.objects.get' : true}
{'storage.objects.getIamPolicy' : true}
{'storage.objects.list' : true}
{'storage.objects.setIamPolicy' : true}
{'storage.objects.update' : true}

我用来测试的代码:

googleBucket.iam.testPermissions([testPermissions], function(err, permissions) {
  if(!err)
    console.log(permissions);
  })

我错过的权限:

'storage.buckets.create',
'storage.buckets.delete',
'storage.buckets.list',
'storage.buckets.setIamPolicy',
'storage.buckets.update',

我对创建对象拥有所有权限感到非常困惑,但是仍然抛出权限不足.我使用的api只是在存储桶中上传文件.我错过了任何许可吗?(服务器位于Google Cloud Storage的同一项目中的Google Compute Engine上)

It's really confused that I got all permission on create objects, but still throw an insufficient permission. What I used for api is just uploading a file on bucket. Is there any permission I missed? (Server is located at Google Compute Engine, on the same project of Google Cloud Storage)

推荐答案

我已经找到了答案.创建新实例页面中有一个名为 Identity and API Access 的选项.只需从默认切换到任何访问选项(正确配置即可),问题就解决了!

I have found the answer precisely. There is an option, called Identity and API Access, in Create a new instance page. Just Switch from Default to whatever access option(do config properly, tho), and the problem sloved!

对于 Martin Zeitler 提供的答案,这不是GCE在运行脚本时所起作用,GCE自动连接它以 Editor 权限将其电子邮件发送到另一个API,而无需将任何json挂钩到在GCE上建立的Instance.如前所述,服务器位于Google Compute Engine的Google Cloud Storage的同一项目中.

For the answer provided by Martin Zeitler, It's not what GCE works on running the script, GCE automatically connect Its email to another API as Editor permission, and no need to Hook any json to Instance that established on GCE. As I mentioned that Server is located at Google Compute Engine, on the same project of Google Cloud Storage.

但是,文档链接很有帮助,谢谢马丁·齐特勒,给您一个快速答案的支持:)

However, Documentation Link is fairly helpful, Thanks Martin Zeitler, give you an upvote for quick answer :)

这篇关于Google云端存储-权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆