Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:02:21+00:00 2026-06-15T05:02:21+00:00

Is it possible to change the ACLs of Google Cloud Storage objects(or buckets) using

  • 0

Is it possible to change the ACLs of Google Cloud Storage objects(or buckets) using the appengine Api? I understand that this can be done using the REST API, but is there support for this in the Files Api in appengine? They can be set when creating a new object using GSFileObject, however can you change on existing objects??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:02:22+00:00Added an answer on June 15, 2026 at 5:02 am

    You can use urlfetch.fetch and app_identity.get_access_token to easily send an authenticated request to the REST api.

    Python:

    from google.appengine.api import app_identity
    from google.appengine.api import urlfetch
    
    acl_xml = """
    <AccessControlList><Entries>
      <Entry>
        <Scope type="UserByEmail">foo@example.com</Scope>
        <Permission>READ</Permission>
      </Entry>
    </Entries></AccessControlList>
    """
    scope = 'https://www.googleapis.com/auth/devstorage.full_control'
    token = app_identity.get_access_token(scope)
    response = urlfetch.fetch(
        'http://storage.googleapis.com/bucket/obj?acl',
        method=urlfetch.PUT,
        payload=acl_xml,
        headers={'Authorization': 'OAuth %s' % token})
    

    Java:

    import com.google.appengine.api.appidentity.AppIdentityService;    
    import com.google.appengine.api.appidentity.AppIdentityServiceFactory;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.ArrayList;
    
    public String setAcl() throws Exception {
      // Change foo@example.com to a valid email.
      // Repeat <Entry/> as many times as necessary.
      String xmlString = "";
      xmlString += "<AccessControlList><Entries>";
      xmlString += "  <Entry>";
      xmlString += "    <Scope type=\"UserByEmail\">foo@example.com</Scope>";
      xmlString += "    <Permission>READ</Permission>";
      xmlString += "  </Entry>";
      xmlString += "</Entries></AccessControlList>";
    
      ArrayList scopes = new ArrayList();
      scopes.add("https://www.googleapis.com/auth/devstorage.full_control");
    
      AppIdentityService.GetAccessTokenResult accessToken =
          AppIdentityServiceFactory.getAppIdentityService().getAccessToken(scopes);
    
      // Change bucket and obj to the bucket and object of interest.
      URL url = new URL("https://storage.googleapis.com/bucket/obj?acl");
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setDoOutput(true);
      connection.setRequestMethod("PUT");
      connection.addRequestProperty(
          "Authorization", "OAuth " + accessToken.getAccessToken());
    
      OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
      writer.write(xmlString);
      writer.close();
    
      if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
        throw new Exception();
      }
    }
    

    More info:

    • Python: https://developers.google.com/appengine/docs/python/appidentity/overview
    • Java: https://developers.google.com/appengine/docs/java/appidentity/overview
    • Relevant oauth scopes: https://developers.google.com/storage/docs/authentication#oauth
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

consulting the Facebook documentation on: http://developers.facebook.com/docs/reference/api/page/#tabs I saw that is possible change the tab
Possible Duplicate: Change the URL in the browser without loading the new page using
Is it possible to change SQL in a z/OS mainframe COBOL application so that
Is possible to change hibernate.jdbc.batch_size programmatically? I understand hibernate.jdbc.batch_size is a application level parameter,
Possible Duplicate: Change tag attribute value with PHP DOMDocument How can i use PHP
Is it possible to change the font size used in a ContextMenu using the
Possible Duplicate: change colors of table with javascript for this problem im trying to
Possible Duplicate: Change Backlight Brightness on iPhone Programmatically How can i adjust brightness in
Possible Duplicate: Change repo name in github I got some github repos that i
Possible Duplicate: Change color of sibling elements on hover using CSS Basically i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.