如何在创建时将域添加到Google Cloud Storage对象ACL中? [英] How to add domain to Google Cloud Storage object ACL at creation?

查看:193
本文介绍了如何在创建时将域添加到Google Cloud Storage对象ACL中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的基于Java的应用程序引擎项目中,我允许用户将文件上传到谷歌云存储(此作品),但我似乎无法将特定域添加到访问列表,以便只有来自我内部的人公司可以访问我的文件。

In my Java based app-engine project, i allow users to upload files to google cloud store (this works), but i can't seem to add a specific domain to the access list, so that only people from within my company can access my files. How do i do this?

我试过使用:

i tried using:

    GcsService gcsService = GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
    GcsFilename gcsFileName = new GcsFilename("my-bucket", user_uploaded_file_name);
    Builder fileOptionsBuilder = new GcsFileOptions.Builder();
    fileOptionsBuilder.mimeType(mimeType);
    fileOptionsBuilder.acl("authenticated-read"); // how do i modify this list?
    GcsFileOptions fileOptions = fileOptionsBuilder.build();
    GcsOutputChannel outputChannel = gcsService.createOrReplace(gcsFileName, fileOptions);

authenticated-read 文件公开(不是我想要的)。我想将组织中的所有人@ mycompany.com添加到访问列表中。我是否通过代码来做到这一点?或者我使用谷歌云控制台来做到这一点?

and this authenticated-read just makes the file public (not what i want). i want to add everyone from the organization "@mycompany.com" to the access list. do i do this through code? or do i do this using the google cloud console?

我将向人们提供通过此网址上传的文件的链接:

I will be providing people the links to files they upload via this url:

字符串网址= https://console.developers.google.com/m/cloudstorage/b/+my-bucket+/ o /+ user_uploaded_file_name;

推荐答案

更改Google的ACL Appengine的云存储(JAVA)

这完全适合我!

这篇关于如何在创建时将域添加到Google Cloud Storage对象ACL中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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