summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_iam_policy.cc
diff options
context:
space:
mode:
authorAbhishek Lekshmanan <abhishek@suse.com>2019-08-30 11:35:34 +0200
committerAbhishek Lekshmanan <abhishek@suse.com>2020-02-03 17:53:31 +0100
commit36bb77d8b7fa953231e941b24c0e81cc3f184a89 (patch)
treee1ede7c1c8f2c011c9b4ebd42ec57a75c8cffd55 /src/rgw/rgw_iam_policy.cc
parentrgw: initial implementation of a public policy tester (diff)
downloadceph-36bb77d8b7fa953231e941b24c0e81cc3f184a89.tar.xz
ceph-36bb77d8b7fa953231e941b24c0e81cc3f184a89.zip
rgw: both princ and nonprinc will not coexist in a single statement
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
Diffstat (limited to 'src/rgw/rgw_iam_policy.cc')
-rw-r--r--src/rgw/rgw_iam_policy.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rgw/rgw_iam_policy.cc b/src/rgw/rgw_iam_policy.cc
index c33db62149c..86bc8ac9be3 100644
--- a/src/rgw/rgw_iam_policy.cc
+++ b/src/rgw/rgw_iam_policy.cc
@@ -1443,14 +1443,13 @@ struct IsPublicStatement
if (s.effect == Effect::Allow) {
for (const auto& p : s.princ) {
if (p.is_wildcard()) {
- if (s.eval_conditions(iam_all_env) == Effect::Allow)
- return true;
+ return s.eval_conditions(iam_all_env) == Effect::Allow;
}
}
// no princ should not contain fixed values
- return std::all_of(s.noprinc.begin(), s.noprinc.end(), [](const rgw::auth::Principal& p) {
- return !p.is_wildcard();
- });
+ return std::none_of(s.noprinc.begin(), s.noprinc.end(), [](const rgw::auth::Principal& p) {
+ return p.is_wildcard();
+ });
}
return false;
}