]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set perm_mask for swift operations
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 6 Sep 2011 21:37:30 +0000 (14:37 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 6 Sep 2011 21:37:57 +0000 (14:37 -0700)
src/rgw/rgw_common.cc
src/rgw/rgw_rest_swift.cc

index abb644efeaccccd719b5de6c9151a9266d38ea8e..c1db8fa59c6f0652bb777721216185a6e45522dc 100644 (file)
@@ -263,7 +263,10 @@ bool verify_permission(RGWAccessControlPolicy *policy, string& uid, int user_per
    if (!policy)
      return false;
 
-   int acl_perm = policy->get_perm(g_ceph_context, uid, perm) & user_perm_mask;
+   int policy_perm = policy->get_perm(g_ceph_context, uid, perm);
+   int acl_perm = policy_perm & user_perm_mask;
+
+   RGW_LOG(10) << " uid=" << uid << " requested perm (type)=" << perm << ", policy perm=" << policy_perm << ", user_perm_mask=" << user_perm_mask << ", acl perm=" << acl_perm << dendl;
 
    return (perm == acl_perm);
 }
index 62e0ec43117e863b1001290b6809470862ef669e..694e47fff95cbc77b43c8c5e2314b13589ea6184 100644 (file)
@@ -303,5 +303,7 @@ int RGWHandler_REST_SWIFT::authorize()
   if (!authorized)
     return -EPERM;
 
+  s->perm_mask = RGW_PERM_FULL_CONTROL;
+
   return 0;
 }