Skip to content

Commit

Permalink
stop checking policies at the first that matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Dec 22, 2021
1 parent e5d9e21 commit 301b442
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/token/authorizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl<'t> Authorizer<'t> {
}
}

for (i, policy) in self.policies.iter().enumerate() {
'policies_test: for (i, policy) in self.policies.iter().enumerate() {
for query in policy.queries.iter() {
let res = self
.world
Expand All @@ -378,6 +378,7 @@ impl<'t> Authorizer<'t> {
PolicyKind::Allow => policy_result = Some(Ok(i)),
PolicyKind::Deny => policy_result = Some(Err(i)),
};
break 'policies_test;
}
}
}
Expand Down

0 comments on commit 301b442

Please sign in to comment.