]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: s3 only shows s3 acls
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 23 Feb 2012 23:34:26 +0000 (15:34 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 23 Feb 2012 23:34:26 +0000 (15:34 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
src/rgw/rgw_acl.h
src/rgw/rgw_acl_s3.cc
src/rgw/rgw_acl_swift.cc
src/rgw/rgw_xml.h

index d0c9fcb20300824fefeccb8ce745d74594546948..e8907e8e71491e049f804dbb67f51a44a5df2815 100644 (file)
@@ -19,7 +19,7 @@ using namespace std;
 #define RGW_PERM_WRITE_OBJS      0x20
 #define RGW_PERM_FULL_CONTROL    ( RGW_PERM_READ | RGW_PERM_WRITE | \
                                   RGW_PERM_READ_ACP | RGW_PERM_WRITE_ACP )
-#define RGW_PERM_ALL             RGW_PERM_FULL_CONTROL
+#define RGW_PERM_ALL_S3          RGW_PERM_FULL_CONTROL
 
 enum ACLGranteeTypeEnum {
 /* numbers are encoded, should not change */
index 0b7d8aa5dab77fa3c26e7b248c24245fd41725cf..dff96304eefc426bf0c9b3564417a5023d42749a 100644 (file)
@@ -195,6 +195,12 @@ bool ACLGrant_S3::xml_end(const char *el) {
 }
 
 void ACLGrant_S3::to_xml(ostream& out) {
+  ACLPermission_S3& perm = static_cast<ACLPermission_S3 &>(permission);
+
+  /* only show s3 compatible permissions */
+  if (!(perm.get_permissions() & RGW_PERM_ALL_S3))
+    return;
+
   out << "<Grant>" <<
          "<Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"" << ACLGranteeType_S3::to_string(type) << "\">";
   switch (type.get_type()) {
@@ -214,7 +220,6 @@ void ACLGrant_S3::to_xml(ostream& out) {
     break;
   }
   out << "</Grantee>";
-  ACLPermission_S3& perm = static_cast<ACLPermission_S3 &>(permission);
   perm.to_xml(out);
   out << "</Grant>";
 }
index c8a217f9821dcdbb60196e6346625ac0c81f2d42..a0038ff9c338230e5eb2d9da5a881670bbf5a22d 100644 (file)
@@ -9,8 +9,8 @@
 
 using namespace std;
 
-#define SWIFT_PERM_READ  RGW_PERM_READ
-#define SWIFT_PERM_WRITE RGW_PERM_WRITE
+#define SWIFT_PERM_READ  RGW_PERM_READ_OBJS
+#define SWIFT_PERM_WRITE RGW_PERM_WRITE_OBJS
 
 static int parse_list(string& uid_list, vector<string>& uids)
 {
index fc8f23d88da1bd492677f259d0691f753ab34188..bb59d5ae68cbd035a3a0a2aeb26bb15c0ab82972 100644 (file)
 using namespace std;
 
 
-#define RGW_URI_ALL_USERS      "http://acs.amazonaws.com/groups/global/AllUsers"
-#define RGW_URI_AUTH_USERS     "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"
-
-#define RGW_PERM_READ            0x01
-#define RGW_PERM_WRITE           0x02
-#define RGW_PERM_READ_ACP        0x04
-#define RGW_PERM_WRITE_ACP       0x08
-#define RGW_PERM_FULL_CONTROL    ( RGW_PERM_READ | RGW_PERM_WRITE | \
-                                  RGW_PERM_READ_ACP | RGW_PERM_WRITE_ACP )
-#define RGW_PERM_ALL             RGW_PERM_FULL_CONTROL
-
 class XMLObj;
 
 class XMLObjIter {