Skip to content

storage: bucket.makePublic(fd, cb) & bucket.makePrivate(fd, cb) #162

Description

@ryanseys

The web interface supports a shared-publicly checkbox (see screenshot below). We should support this functionality for easy-share links! BAM!

Something like this:

bucket.makePublic('filename.png', function(err, public_url) {
  console.log(public_url); // https://storage.googleapis.com/bucket-name/filename.png
}); // could also return file stat instead of public url for more info

bucket.makePrivate('filename.png', function(err, stat) {
  console.log(stat.acl); // [] (assuming acl is the ObjectAccessControls object here) 
});

Screenshot:

screen shot 2014-08-31 at 11 25 03 pm

Activity

  1. changed the title [-]bucket.makePublic(fd, cb) & bucket.makePrivate(fd, cb) && object.[/-] [+]bucket.makePublic(fd, cb) & bucket.makePrivate(fd, cb)[/+] on Sep 1, 2014
  2. changed the title [-]bucket.makePublic(fd, cb) & bucket.makePrivate(fd, cb)[/-] [+]storage: bucket.makePublic(fd, cb) & bucket.makePrivate(fd, cb)[/+] on Sep 2, 2014
  3. rakyll commented on Sep 2, 2014

    @rakyll
    Contributor

    This should go into the write operation as previously suggested. ACL changes should succeed and fail with metadata/contents changes atomically.

    Btw, in your use case, you can set bucket's default ACL to be publicly readable. https://developers.google.com/storage/docs/json_api/v1/defaultObjectAccessControls/insert (Developers Console has a screen to manage bucket ACL as well.) You dont have to set ACL for each individual file.

    Most of the time, people create a separate bucket for public blobs.

  4. ryanseys commented on Sep 3, 2014

    @ryanseys
    ContributorAuthor

    Oh okay, I'll close this.

  5. added
    api: storageIssues related to the Cloud Storage API.
    and removed
    api: storageIssues related to the Cloud Storage API.
    on Feb 2, 2015
  6. added this to the Storage Stable milestone on Feb 2, 2015
  7. 63 remaining items

  8. added a commit that references this issue on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions