-
Notifications
You must be signed in to change notification settings - Fork 640
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
Milestone
Description
** revised proposal: #351 (comment) **
Hi guys,
In gcloud-node, the ACL methods are very closely tied to the API specification, for example:
myBucket.acl.add({
scope: '[email protected]',
permission: Storage.acl.OWNER_ROLE
}, function(err, aclObject) {});There are definitely times where I want to do low level operations, but other times I want to first-class citizen methods for the different options... Additionally, I now have to know a few things about this API:
- the name of the
scopeparameter - the name of the
permissionparameter - the fact that user's need to be prefixed with
user- - the constant for the name of the role (
OWNER_ROLE... is itREADER_ROLEorREAD_ROLE?) and where to look for those constants when I inevitably forget them...
Can take a stab at making this more friendly? For example, it might be cool to have:
myBucket.acl.owners.addUser('[email protected]', function(err, aclObject) {});
myBucket.acl.readers.removeDomain('example.com', function(err, aclObject) {});
myBucket.acl.writers.addAllUsers(function(err, aclObject) {});
myBucket.acl.readers.addAllAuthenticatedUsers(function(err, aclObject) {});Or we could go the same route that gcloud-python went with the grant_* and revoke_* directives acting as the "commit" operation, so the code would look like:
myBucket.acl.user('[email protected]').grantOwner(function(err, aclObject) {})
myBucket.acl.domain('example.com').revokeRead(function(err, aclObject) {})
myBucket.acl.allUsers().grantWrite(function(err, aclObject) {})
myBucket.acl.allAuthenticatedUsers().grantRead(function(err, aclObject) {})Ideally you could chain this stuff together:
myBucket.acl.user('[email protected]').user('[email protected]').grantOwner(function(err, aclObject) {})Thoughts?
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.