Since DRF==3.9--(release notes) we have got an option to combine/compose the permission classes in our views.
class MyViewSet(...):
permission_classes = [FooPermission & BarPermission]
I did try something like this,
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'utils.permissions.FooPermission' & 'utils.permissions.BarPermission',
),
# other settings
}
and python raised exception
TypeError: unsupported operand type(s) for &: 'str' and 'str'
So,
How can I use combined permission as global permission using DEFAULT_PERMISSION_CLASSES
?