]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allow giving perms in Swift ACLs to an identity who don't have a local account.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Sun, 17 Apr 2016 10:22:27 +0000 (12:22 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Jun 2016 13:37:05 +0000 (15:37 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_acl.h
src/rgw/rgw_acl_swift.cc

index 6ae2cbd0621eea60915689600bdd0f5e40a72e16..f10998beb8612d77c976fa1dc03708f9b6cfa25e 100644 (file)
@@ -184,7 +184,7 @@ public:
 
   ACLGroupTypeEnum uri_to_group(string& uri);
   
-  void set_canon(const rgw_user& _id, string& _name, int perm) {
+  void set_canon(const rgw_user& _id, const string& _name, const  int perm) {
     type.set(ACL_TYPE_CANON_USER);
     id = _id;
     name = _name;
index 731c98585dd12ffec1e97fe738d64d266e024b10..228866ce0838712167826af845f90ba63bd7506f 100644 (file)
@@ -138,6 +138,8 @@ void RGWAccessControlPolicy_SWIFT::add_grants(RGWRados * const store,
       if (rgw_get_user_info_by_uid(store, user, grant_user) < 0) {
         ldout(cct, 10) << "grant user does not exist: " << uid << dendl;
         /* skipping silently */
+        grant.set_canon(user, std::string(), perm);
+        acl.add_grant(&grant);
       } else {
         grant.set_canon(user, grant_user.display_name, perm);
         acl.add_grant(&grant);
@@ -224,6 +226,8 @@ void RGWAccessControlPolicy_SWIFTAcct::add_grants(RGWRados * const store,
       if (rgw_get_user_info_by_uid(store, user, grant_user) < 0) {
         ldout(cct, 10) << "grant user does not exist:" << uid << dendl;
         /* skipping silently */
+        grant.set_canon(user, std::string(), perm);
+        acl.add_grant(&grant);
       } else {
         grant.set_canon(user, grant_user.display_name, perm);
         acl.add_grant(&grant);