Skip to content

Commit

Permalink
Merge pull request #359 from ryanseys/fix-storage-roles
Browse files Browse the repository at this point in the history
fix storage acl roles documentation
  • Loading branch information
stephenplusplus committed Jan 20, 2015
2 parents ef34525 + 2e5a132 commit b000f81
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ var util = require('./common/util.js');
* // projectId: 'my-project'
* // });
*
* var bucket = gcloud.storage.bucket({
* var storage = gcloud.storage();
* var bucket = storage.bucket({
* name: 'PhotosBucket',
* // properties may be overridden:
* keyFilename: '/path/to/other/keyfile.json'
Expand Down
9 changes: 5 additions & 4 deletions lib/storage/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ var RESUMABLE_THRESHOLD = 5000000;
*
* @example
* var gcloud = require('gcloud');
* var storage = gcloud.storage();
*
* // From Google Compute Engine
* var albums = gcloud.storage.bucket('albums');
* var albums = storage.bucket('albums');
*
* // From elsewhere
* var photos = gcloud.storage.bucket({
* keyFilename: '/path/to/keyfile.json',
* var photos = storage.bucket({
* keyFilename: '/path/to/keyfile.json', // If you have not yet provided it.
* name: 'bucket'
* });
*/
Expand Down Expand Up @@ -126,7 +127,7 @@ function Bucket(storage, name) {
* //-
* myBucket.acl.add({
* scope: 'allUsers',
* permission: Storage.acl.READER_ROLE
* permission: storage.acl.READER_ROLE
* }, function(err, aclObject) {});
*/
this.acl = new Acl({
Expand Down
2 changes: 1 addition & 1 deletion lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function File(bucket, name, metadata) {
* //-
* myFile.acl.add({
* scope: 'allUsers',
* permission: Storage.acl.READER_ROLE
* permission: storage.acl.READER_ROLE
* }, function(err, aclObject) {});
*/
this.acl = new Acl({
Expand Down
27 changes: 16 additions & 11 deletions lib/storage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ var STORAGE_BASE_URL = 'https://www.googleapis.com/storage/v1/b';
* //-
*
* // Access `storage` through the `gcloud` module directly.
* var musicBucket = gcloud.storage().bucket('music');
* var storage = gcloud.storage();
* var musicBucket = storage.bucket('music');
*
* //-
* // Elsewhere.
Expand All @@ -86,8 +87,10 @@ var STORAGE_BASE_URL = 'https://www.googleapis.com/storage/v1/b';
* projectId: 'my-project'
* });
*
* var albums = myProject.storage().bucket('albums');
* var photos = myProject.storage().bucket('photos');
* // Use default configuration details.
* var storage = myProject.storage();
* var albums = storage.bucket('albums');
* var photos = storage.bucket('photos');
*
*
* // Override default configuration details.
Expand Down Expand Up @@ -118,9 +121,9 @@ function Storage(config) {
* This object provides constants to refer to the three permission levels that
* can be granted to a scope:
*
* - `Storage.acl.OWNER_ROLE` - ("OWNER")
* - `Storage.acl.READER_ROLE` - ("READER")
* - `Storage.acl.WRITER_ROLE` - ("WRITER")
* - `storage.acl.OWNER_ROLE` - ("OWNER")
* - `storage.acl.READER_ROLE` - ("READER")
* - `storage.acl.WRITER_ROLE` - ("WRITER")
*
* For more detailed information, see
* [About Access Control Lists](http://goo.gl/6qBBPO).
Expand All @@ -136,15 +139,15 @@ function Storage(config) {
* //-
* albums.acl.add({
* scope: 'allUsers',
* permission: Storage.acl.READER_ROLE
* 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
* permission: storage.acl.READER_ROLE
* }, function(err, aclObject) {});
*
* //-
Expand All @@ -153,7 +156,7 @@ function Storage(config) {
*
* albums.acl.add({
* scope: 'user-useremail@example.com',
* permission: Storage.acl.OWNER_ROLE
* permission: storage.acl.OWNER_ROLE
* }, function(err, aclObject) {});
*/
Storage.acl = {
Expand All @@ -175,8 +178,10 @@ Storage.prototype.acl = Storage.acl;
* keyFilename: '/path/to/keyfile.json'
* });
*
* var albums = gcloud.storage().bucket('albums');
* var photos = gcloud.storage().bucket('photos');
* var storage = gcloud.storage();
*
* var albums = storage.bucket('albums');
* var photos = storage.bucket('photos');
*/
Storage.prototype.bucket = function(name) {
return new Bucket(this, name);
Expand Down

0 comments on commit b000f81

Please sign in to comment.