Add api admin check
This commit is contained in:
parent
a2064d3e99
commit
622cb351b7
1 changed files with 6 additions and 0 deletions
6
archivist/apps/api/permissions.py
Normal file
6
archivist/apps/api/permissions.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
# permissions.py
|
||||
|
||||
def check_admin(user):
|
||||
"""check for admin permission for restricted views"""
|
||||
return user.is_staff or user.groups.filter(name="admin").exists()
|
||||
|
Loading…
Reference in a new issue