mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:59:18 +02:00
See #230: can now use "or" operator to check permissions
This commit is contained in:
parent
ed6c1a9a5b
commit
dfb4f5f62a
5 changed files with 50 additions and 7 deletions
|
@ -16,4 +16,6 @@ class HasUserPermission(BasePermission):
|
|||
return False
|
||||
if request.user.is_anonymous:
|
||||
return False
|
||||
return request.user.has_permissions(*view.required_permissions)
|
||||
operator = getattr(view, 'permission_operator', 'and')
|
||||
return request.user.has_permissions(
|
||||
*view.required_permissions, operator=operator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue