diff --git a/lib/storage/bucket.js b/lib/storage/bucket.js index 7e5c498fb72..7056e25bccb 100644 --- a/lib/storage/bucket.js +++ b/lib/storage/bucket.js @@ -119,6 +119,15 @@ function Bucket(storage, name) { * {module:storage/bucket#acl.default}. * * @mixes module:storage/acl + * + * @example + * //- + * // Make a bucket's contents publicly readable. + * //- + * myBucket.acl.add({ + * scope: 'allUsers', + * permission: Storage.acl.READER_ROLE + * }, function(err, aclObject) {}); */ this.acl = new Acl({ makeReq: this.makeReq_.bind(this), diff --git a/lib/storage/file.js b/lib/storage/file.js index 8e1a26ef7cf..e4045b8e8f3 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -94,6 +94,15 @@ function File(bucket, name, metadata) { * the ACLs defined on your bucket, as well as set, update, and delete them. * * @mixes module:storage/acl + * + * @example + * //- + * // Make a file publicly readable. + * //- + * myFile.acl.add({ + * scope: 'allUsers', + * permission: Storage.acl.READER_ROLE + * }, function(err, aclObject) {}); */ this.acl = new Acl({ makeReq: this.makeReq_, diff --git a/lib/storage/index.js b/lib/storage/index.js index e94991643e8..4348b9aa534 100644 --- a/lib/storage/index.js +++ b/lib/storage/index.js @@ -131,6 +131,26 @@ function Storage(config) { * var storage = gcloud.storage(); * var albums = storage.bucket('albums'); * + * //- + * // Make all of the files currently in a bucket publicly readable. + * //- + * albums.acl.add({ + * scope: 'allUsers', + * permission: Storage.acl.READER_ROLE + * }, function(err, aclObject) {}); + * + * //- + * // Make any new objects added to a bucket publicly readable. + * //- + * albums.acl.default.add({ + * scope: 'allUsers', + * permission: Storage.acl.READER_ROLE + * }, function(err, aclObject) {}); + * + * //- + * // Grant a user ownership permissions to a bucket. + * //- + * * albums.acl.add({ * scope: 'user-useremail@example.com', * permission: Storage.acl.OWNER_ROLE