Permalink
Browse files

* s3cmd, S3/ACL.py: Print all ACLs for a Grantee

(one Grantee can have multiple different Grant entries)



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@405 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 47116ee commit 6d87691acad0d10779e27e87e27b7e0e69200c77 ludvigm committed Mar 19, 2010
Showing with 10 additions and 5 deletions.
  1. +5 −0 ChangeLog
  2. +2 −2 S3/ACL.py
  3. +3 −3 s3cmd
View
@@ -1,5 +1,10 @@
2010-03-19 Michal Ludvig <mludvig@logix.net.nz>
+ * s3cmd, S3/ACL.py: Print all ACLs for a Grantee
+ (one Grantee can have multiple different Grant entries)
+
+2010-03-19 Michal Ludvig <mludvig@logix.net.nz>
+
* s3cmd: Enable bucket-level ACL setting
* s3cmd, S3/AccessLog.py, ...: Added [accesslog] command.
* s3cmd: Fix imports from S3.Utils
View
@@ -99,15 +99,15 @@ def parseGrants(self, tree):
self.grantees.append(grantee)
def getGrantList(self):
- acl = {}
+ acl = []
for grantee in self.grantees:
if grantee.display_name:
user = grantee.display_name
elif grantee.isAllUsers():
user = "*anon*"
else:
user = grantee.name
- acl[user] = grantee.permission
+ acl.append({'grantee': user, 'permission': grantee.permission})
return acl
def getOwner(self):
View
6 s3cmd
@@ -603,9 +603,9 @@ def cmd_info(args):
output(u"%s (bucket):" % uri.uri())
output(u" Location: %s" % info['bucket-location'])
acl = s3.get_acl(uri)
- acl_list = acl.getGrantList()
- for user in acl_list:
- output(u" ACL: %s: %s" % (user, acl_list[user]))
+ acl_grant_list = acl.getGrantList()
+ for grant in acl_grant_list:
+ output(u" ACL: %s: %s" % (grant['grantee'], grant['permission']))
if acl.isAnonRead():
output(u" URL: %s" % uri.public_url())
except S3Error, e:

0 comments on commit 6d87691

Please sign in to comment.