pub fn when<F>(predicate: F) -> When<F>Expand description
Allows every ability while predicate holds for the request.
fn editor(cx: &Cx) -> bool {
auth::user::<Staff>(cx).is_some_and(|staff| staff.editor)
}
fn post_policy() -> impl Policy<Post> {
ReadOnly.or(when(editor))
}