Add api admin check

This commit is contained in:
Aroy-Art 2025-01-02 23:02:38 +01:00
parent a2064d3e99
commit 622cb351b7
Signed by: Aroy
GPG key ID: 583642324A1D2070

View 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()