Since the other edge case when no Principal or a NotPrincipal is supplied also
must be accounted for, which is already done in eval_principal function. Also
reraising the error as Effect::Pass in line with the previous output, though an
Effect::Deny would also work here.
Fixes: https://tracker.ceph.com/issues/46078
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit
1843f2dca853f97c6c9b4196eaf27581705be0e2)
Effect Statement::eval(const Environment& e,
boost::optional<const rgw::auth::Identity&> ida,
uint64_t act, const ARN& res) const {
- if (ida) {
- if (!princ.empty() && !ida->is_identity(princ)) {
- return Effect::Pass;
- } else if (!noprinc.empty() && ida->is_identity(noprinc)) {
- return Effect::Pass;
- }
+
+ if (eval_principal(e, ida) == Effect::Deny) {
+ return Effect::Pass;
}
if (!resource.empty()) {