Add config flag to bypass group authorisation for demo
This commit is contained in:
parent
5336a80125
commit
04093baf47
@ -28,6 +28,8 @@ ALLOWED_HOSTS = []
|
||||
PROMO_LOGO_URL = 'https://placehold.it/2000x500'
|
||||
PROMO_LOGO_LINK = 'https://example.com'
|
||||
|
||||
ENFORCE_GROUP_MANAGERS = True
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from jsonfield import JSONField
|
||||
|
||||
@ -30,6 +31,8 @@ class Group(models.Model):
|
||||
return self.name
|
||||
|
||||
def can_user_access(self, user):
|
||||
if not settings.ENFORCE_GROUP_MANAGERS:
|
||||
return True
|
||||
if user.is_superuser:
|
||||
return True
|
||||
if user.email in self.managers:
|
||||
|
Loading…
Reference in New Issue
Block a user