Browse code

* 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

Michal Ludvig authored on 2010/03/19 13:30:46
Showing 3 changed files
... ...
@@ -1,5 +1,10 @@
1 1
 2010-03-19  Michal Ludvig  <mludvig@logix.net.nz>
2 2
 
3
+	* s3cmd, S3/ACL.py: Print all ACLs for a Grantee
4
+	(one Grantee can have multiple different Grant entries)
5
+
6
+2010-03-19  Michal Ludvig  <mludvig@logix.net.nz>
7
+
3 8
 	* s3cmd: Enable bucket-level ACL setting
4 9
 	* s3cmd, S3/AccessLog.py, ...: Added [accesslog] command.
5 10
 	* s3cmd: Fix imports from S3.Utils
... ...
@@ -99,7 +99,7 @@ class ACL(object):
99 99
 			self.grantees.append(grantee)
100 100
 
101 101
 	def getGrantList(self):
102
-		acl = {}
102
+		acl = []
103 103
 		for grantee in self.grantees:
104 104
 			if grantee.display_name:
105 105
 				user = grantee.display_name
... ...
@@ -107,7 +107,7 @@ class ACL(object):
107 107
 				user = "*anon*"
108 108
 			else:
109 109
 				user = grantee.name
110
-			acl[user] = grantee.permission
110
+			acl.append({'grantee': user, 'permission': grantee.permission})
111 111
 		return acl
112 112
 
113 113
 	def getOwner(self):
... ...
@@ -603,9 +603,9 @@ def cmd_info(args):
603 603
 				output(u"%s (bucket):" % uri.uri())
604 604
 				output(u"   Location:  %s" % info['bucket-location'])
605 605
 			acl = s3.get_acl(uri)
606
-			acl_list = acl.getGrantList()
607
-			for user in acl_list:
608
-				output(u"   ACL:       %s: %s" % (user, acl_list[user]))
606
+			acl_grant_list = acl.getGrantList()
607
+			for grant in acl_grant_list:
608
+				output(u"   ACL:       %s: %s" % (grant['grantee'], grant['permission']))
609 609
 			if acl.isAnonRead():
610 610
 				output(u"   URL:       %s" % uri.public_url())
611 611
 		except S3Error, e: