From: Enming.Zhang Date: Tue, 27 Nov 2018 11:41:56 +0000 (-0500) Subject: rgw: cleanup for RGWDeleteObj::verify_permission() X-Git-Tag: v13.2.5~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c109060caa0091461d2d91ca4efa731a4142ab30;p=ceph.git rgw: cleanup for RGWDeleteObj::verify_permission() - if the 'Effect' field of user policy and bucket policy is set to 'Allow', RGWDeleteObj::verify_permission() should return 0 instead of true; - as the same with bucket policy, if the 'Effect' field of user policy is set to 'Deny', RGWDeleteObj::verify_permission() should return -EACCES instead of false; Signed-off-by: Enming.Zhang (cherry picked from commit 86334645cf96c03515d30804e2df0bdf22916fb5) Conflicts: src/rgw/rgw_op.cc : Resolve in verify_permission --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a54b512f047e..0565fce5e05f 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -4350,7 +4350,7 @@ int RGWDeleteObj::verify_permission() rgw::IAM::s3DeleteObjectVersion, ARN(s->bucket, s->object.name)); if (r == Effect::Allow) - return true; + return 0; else if (r == Effect::Deny) return -EACCES; }