diff --git a/ChangeLog b/ChangeLog index 91d80f8..ad19aa0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-03-19 Michal Ludvig + + * s3cmd, S3/ACL.py: Print all ACLs for a Grantee + (one Grantee can have multiple different Grant entries) + 2010-03-19 Michal Ludvig * s3cmd: Enable bucket-level ACL setting diff --git a/S3/ACL.py b/S3/ACL.py index 67b1530..4bb4930 100644 --- a/S3/ACL.py +++ b/S3/ACL.py @@ -99,7 +99,7 @@ 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 @@ -107,7 +107,7 @@ def getGrantList(self): user = "*anon*" else: user = grantee.name - acl[user] = grantee.permission + acl.append({'grantee': user, 'permission': grantee.permission}) return acl def getOwner(self): diff --git a/s3cmd b/s3cmd index af81b10..7641679 100755 --- a/s3cmd +++ b/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: