]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: support for ExistingObjectTag for PutObjectTagging operation
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 16 Aug 2017 12:07:43 +0000 (14:07 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 17 Jan 2018 10:28:56 +0000 (11:28 +0100)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_op.cc

index 51af512df87255c187dcbeae0d5caa30e1901588..c08d27742c31b4d2ba0904bedc242e43ac021f26 100644 (file)
@@ -785,10 +785,9 @@ void RGWGetObjTags::execute()
 
 int RGWPutObjTags::verify_permission()
 {
-  if (!verify_object_permission(s,
-                               s->object.instance.empty() ?
-                               rgw::IAM::s3PutObjectTagging:
-                               rgw::IAM::s3PutObjectVersionTagging))
+  iam_action = s->object.instance.empty() ?
+    rgw::IAM::s3PutObjectTagging: rgw::IAM::s3PutObjectVersionTagging;
+  if (!verify_object_permission(s,iam_action))
     return -EACCES;
   return 0;
 }
@@ -806,6 +805,7 @@ void RGWPutObjTags::execute()
 
   rgw_obj obj;
   obj = rgw_obj(s->bucket, s->object);
+  op_ret = rgw_iam_eval_existing_objtags(store, s, obj, iam_action);
   store->set_atomic(s->obj_ctx, obj);
   op_ret = modify_obj_attr(store, s, obj, RGW_ATTR_TAGS, tags_bl);
   if (op_ret == -ECANCELED){