diff --git a/archivist/apps/api/permissions.py b/archivist/apps/api/permissions.py new file mode 100644 index 0000000..bc52a72 --- /dev/null +++ b/archivist/apps/api/permissions.py @@ -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() +