Skip to content

Commit

Permalink
fix: mask out rule permissions before merging permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Feb 26, 2024
1 parent e08c289 commit 8241819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ACL/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static function mergeRules(array $rules): Rule {
}, 0);
// or'ing the permissions combines them with allow overwriting deny
$permissions = array_reduce($rules, function (int $permissions, Rule $rule) {
return $permissions | $rule->getPermissions();
return $permissions | ($rule->getPermissions() & $rule->getMask());
}, 0);

return new Rule(
Expand Down

0 comments on commit 8241819

Please sign in to comment.