From 2a13868621b51a33903287664c58a85bb2393025 Mon Sep 17 00:00:00 2001 From: "Enming.Zhang" Date: Tue, 27 Nov 2018 06:41:56 -0500 Subject: [PATCH] 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 : Resolved in verify_permission --- src/rgw/rgw_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 31925e57db753..f9e67c0d75d39 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -4238,7 +4238,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; } -- 2.39.5