Search code examples
gcloud-node

How to set Google Cloud Storage ACLs with gcloud-node?


The library was announced recently, which is much simpler to use than the old google apis client http://googlecloudplatform.blogspot.jp/2014/09/gcloud-node-google-cloud-platform-client-library-for-nodejs.html


Solution

  • You can set them with the ACL meta data as follows:

    bucket.createWriteStream(filename, {
            'acl': [
              {
                "entity": "allUsers",
                "role": "READER"
              }
            ]
          });
    

    This will set a object to public.