Gallery-Archivist/archivist/apps/api/permissions.py

7 lines
170 B
Python
Raw Normal View History

2025-01-02 23:02:38 +01:00
# permissions.py
def check_admin(user):
"""check for admin permission for restricted views"""
return user.is_staff or user.groups.filter(name="admin").exists()