mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 01:58:54 +02:00
feat(app): disable API when demo mode is enabled
This commit is contained in:
10
app/apps/api/permissions.py
Normal file
10
app/apps/api/permissions.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from rest_framework.permissions import BasePermission
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class NotInDemoMode(BasePermission):
|
||||
def has_permission(self, request, view):
|
||||
if settings.DEMO and not request.user.is_superuser:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
Reference in New Issue
Block a user