Permission combinators¶
DRF supports boolean composition of permission classes through the
&, |, and ~ operators with brackets for grouping. Operators
follow Python's logical precedence (~ highest, then &, then |).
Restflow ships async-native subclasses of DRF's combinator
classes so combinator branches resolve through the async hook
.
See the Permissions guide for short-circuit behaviour and worked examples.
AND ¶
Bases: AND
Permission combinator produced by perm1 & perm2. Adds async ahas_permission and ahas_object_permission that short-circuit on the first denying operand.
OR ¶
Bases: OR
Permission combinator produced by perm1 | perm2. Adds async ahas_permission and ahas_object_permission that short-circuit on the first allowing operand.
NOT ¶
Bases: NOT
Permission combinator produced by ~perm. Adds async ahas_permission and ahas_object_permission that invert the wrapped permission's verdict.