如何在创建时将域添加到Google Cloud Storage对象ACL中? [英] How to add domain to Google Cloud Storage object ACL at creation?
问题描述
在我的基于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);
和
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屋!