Currently, permissions are provided as a list of BasePermission
instances, treated implicitly as ANDs. It would be grand to instead be able to use AND and OR operators when passing in permissions.
This has been discussed on discord. Proposed approach is overriding the &
and |
operators for BasePermission
, which would allow permissions to be passed in as follows:
IsAuthed() & (ControlsAccount() | IsAdmin())
This may need some changes to the on_unauthorized
and has_permission
interface, as the separation / statelessness between has_permission
and on_unauthorized
means that a parent permission's on_unauthorized
wouldn't know WHICH of its child permissions failed.
Additionally, some thought will be needed to handling the combination of sync and async combined permissions
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too