You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/storage/bucket.js
+71-64Lines changed: 71 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -78,83 +78,90 @@ var STORAGE_BASE_URL = 'https://www.googleapis.com/storage/v1/b';
78
78
* });
79
79
*/
80
80
functionBucket(storage,name){
81
-
this.acl=newAcl(this);
82
81
this.metadata={};
83
82
this.name=name;
84
83
this.storage=storage;
85
84
86
85
if(!this.name){
87
86
throwError('A bucket name is needed to use Google Cloud Storage.');
88
87
}
89
-
}
90
88
91
-
/**
92
-
* Google Cloud Storage uses access control lists (ACLs) to manage object and
93
-
* bucket access. ACLs are the mechanism you use to share objects with other
94
-
* users and allow other users to access your buckets and objects.
95
-
*
96
-
* An ACL consists of one or more entries, where each entry grants permissions
97
-
* to a scope. Permissions define the actions that can be performed against an
98
-
* object or bucket (for example, `READ` or `WRITE`); the scope defines who the
99
-
* permission applies to (for example, a specific user or group of users).
100
-
*
101
-
* For more detailed information, see
102
-
* [About Access Control Lists](http://goo.gl/6qBBPO).
103
-
*
104
-
* The `acl` object on a Bucket instance provides methods to get you a list of
105
-
* the ACLs defined on your bucket, as well as set, update, and delete them.
* for all created files. You can add, delete, get, and update scopes and
110
-
* permissions for these as well. See {module:storage/acl#acl.default}.
111
-
*
112
-
* @mixes module:storage/acl
113
-
*/
114
-
Bucket.prototype.acl={};
89
+
/**
90
+
* Google Cloud Storage uses access control lists (ACLs) to manage object and
91
+
* bucket access. ACLs are the mechanism you use to share objects with other
92
+
* users and allow other users to access your buckets and objects.
93
+
*
94
+
* An ACL consists of one or more entries, where each entry grants permissions
95
+
* to a scope. Permissions define the actions that can be performed against an
96
+
* object or bucket (for example, `READ` or `WRITE`); the scope defines who
97
+
* the permission applies to (for example, a specific user or group of users).
98
+
*
99
+
* For more detailed information, see
100
+
* [About Access Control Lists](http://goo.gl/6qBBPO).
101
+
*
102
+
* The `acl` object on a Bucket instance provides methods to get you a list of
103
+
* the ACLs defined on your bucket, as well as set, update, and delete them.
* for all created files. You can add, delete, get, and update scopes and
108
+
* permissions for these as well. See {module:storage/acl#acl.default}.
109
+
*
110
+
* @mixes module:storage/acl
111
+
*/
112
+
this.acl=newAcl({
113
+
makeReq: this.makeReq_.bind(this),
114
+
pathPrefix: '/acl'
115
+
});
115
116
116
-
/* jshint ignore:start */
117
-
/*! Developer Documentation
118
-
*
119
-
* Sadly, to generate the documentation properly, this comment block describes a
120
-
* useless variable named `ignored` and aliases it to `acl.default`. This is
121
-
* done so the doc building process picks this up, without adding cruft to the
122
-
* Bucket class itself.
123
-
*/
124
-
/**
125
-
* Google Cloud Storage Buckets have [default ACLs](http://goo.gl/YpGdyv)
126
-
* for all created files. You can add, delete, get, and update scopes and
127
-
* permissions for these as well. The method signatures and examples are all
128
-
* the same, after only prefixing the method call with `default`.
129
-
*
130
-
* @alias acl.default
131
-
*/
132
-
varaclDefault=true;
117
+
this.acl.default=newAcl({
118
+
makeReq: this.makeReq_.bind(this),
119
+
pathPrefix: '/defaultObjectAcl'
120
+
});
133
121
134
-
/**
135
-
* Maps to {module:storage/bucket#acl.add}.
136
-
* @alias acl.default.add
137
-
*/
138
-
varaclDefaultAdd=true;
122
+
/* jshint ignore:start */
123
+
/*! Developer Documentation
124
+
*
125
+
* Sadly, to generate the documentation properly, this comment block describes
126
+
* a useless variable named `ignored` and aliases it to `acl.default`. This is
127
+
* done so the doc building process picks this up, without adding cruft to the
128
+
* Bucket class itself.
129
+
*/
130
+
/**
131
+
* Google Cloud Storage Buckets have [default ACLs](http://goo.gl/YpGdyv) for
132
+
* all created files. You can add, delete, get, and update scopes and
133
+
* permissions for these as well. The method signatures and examples are all
134
+
* the same, after only prefixing the method call with `default`.
Copy file name to clipboardExpand all lines: lib/storage/file.js
+24-21Lines changed: 24 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -66,33 +66,36 @@ function File(bucket, name, metadata) {
66
66
67
67
this.bucket=bucket;
68
68
this.makeReq_=bucket.makeReq_.bind(bucket);
69
-
this.acl=newAcl(this);
70
69
this.metadata=metadata||{};
70
+
71
71
Object.defineProperty(this,'name',{
72
72
enumerable: true,
73
73
value: name
74
74
});
75
-
}
76
75
77
-
/**
78
-
* Google Cloud Storage uses access control lists (ACLs) to manage object and
79
-
* bucket access. ACLs are the mechanism you use to share objects with other
80
-
* users and allow other users to access your buckets and objects.
81
-
*
82
-
* An ACL consists of one or more entries, where each entry grants permissions
83
-
* to a scope. Permissions define the actions that can be performed against an
84
-
* object or bucket (for example, `READ` or `WRITE`); the scope defines who the
85
-
* permission applies to (for example, a specific user or group of users).
86
-
*
87
-
* For more detailed information, see
88
-
* [About Access Control Lists](http://goo.gl/6qBBPO).
89
-
*
90
-
* The `acl` object on a File instance provides methods to get you a list of
91
-
* the ACLs defined on your bucket, as well as set, update, and delete them.
92
-
*
93
-
* @mixes module:storage/acl
94
-
*/
95
-
File.prototype.acl={};
76
+
/**
77
+
* Google Cloud Storage uses access control lists (ACLs) to manage object and
78
+
* bucket access. ACLs are the mechanism you use to share objects with other
79
+
* users and allow other users to access your buckets and objects.
80
+
*
81
+
* An ACL consists of one or more entries, where each entry grants permissions
82
+
* to a scope. Permissions define the actions that can be performed against an
83
+
* object or bucket (for example, `READ` or `WRITE`); the scope defines who
84
+
* the permission applies to (for example, a specific user or group of users).
85
+
*
86
+
* For more detailed information, see
87
+
* [About Access Control Lists](http://goo.gl/6qBBPO).
88
+
*
89
+
* The `acl` object on a File instance provides methods to get you a list of
90
+
* the ACLs defined on your bucket, as well as set, update, and delete them.
0 commit comments