As NotPrincipal cannot be used with Effect Allow there is no need to
check for that.
Also before this change, policies without `NotPrincipal` were identified
as a public as std::none_of() returns true on empty flats and the check
was not considering the fact that the policy might have pricipals. but
due to the missing concept from AWS about how to deal with Principal and
NotPrincipal on Allow Effect we can just remove it.
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
bool operator() (const Statement &s) const {
if (s.effect == Effect::Allow) {
for (const auto& p : s.princ) {
- if (p.is_wildcard()) {
- return s.eval_conditions(iam_all_env) == Effect::Allow;
- }
+ if (p.is_wildcard()) {
+ return s.eval_conditions(iam_all_env) == Effect::Allow;
+ }
}
- // no princ should not contain fixed values
- return std::none_of(s.noprinc.begin(), s.noprinc.end(), [](const rgw::auth::Principal& p) {
- return p.is_wildcard();
- });
}
return false;
}