Skip to content

Commit

Permalink
policyeval: do full evaluate on matched users when handling new policy
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 3, 2024
1 parent 3488431 commit 329bf60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion policyeval/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func (pe *PolicyEvaluator) EvaluateAddedRule(ctx context.Context, policy *policy
pe.protectedRoomsLock.RUnlock()
for _, userID := range users {
if policy.Pattern.Match(string(userID)) {
pe.ApplyPolicy(ctx, userID, policylist.Match{policy})
// Do a full evaluation to ensure new policies don't bypass existing higher priority policies
pe.EvaluateUser(ctx, userID)
}
}
}
Expand Down

0 comments on commit 329bf60

Please sign in to comment.