[FEATURE] Allow logical operator between permissions inheriting BasePermission
qcoumes opened this issue · comments
Is your feature request related to a problem? Please describe.
Allow logical operator on permissions inheriting from from djangochannelsrestframework.permissions.BasePermission
.
Describe the solution you'd like
I would like to be able to use OR
(or more complex) operations between permissions, for instance:
IsAdmin = (IsAdminUser | IsAdminCare | IsAdminEDS)
Additional context
In DRF, you can use logical operators &
and |
to combine permissions in complex ways. This works because DRF's BasePermissions
has a metaclass BasePermissionMetaclass
defined as follow : BasePermissionMetaclass(OperationHolderMixin, type)
.
I don't know if just using the same metaclass can work, but is it probably worth investigating.