.
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
from .models import Atlas, Series
|
from .models import Case, Series
|
||||||
|
|
||||||
def user_is_author_or_atlas_series_checker_or_atlas_marker(function):
|
def user_is_author_or_atlas_series_checker_or_atlas_marker(function):
|
||||||
def wrap(request, *args, **kwargs):
|
def wrap(request, *args, **kwargs):
|
||||||
@@ -25,7 +25,7 @@ def user_is_author_or_atlas_series_checker(function):
|
|||||||
|
|
||||||
def user_is_author_or_atlas_checker_or_atlas_marker(function):
|
def user_is_author_or_atlas_checker_or_atlas_marker(function):
|
||||||
def wrap(request, *args, **kwargs):
|
def wrap(request, *args, **kwargs):
|
||||||
atlas = Atlas.objects.get(pk=kwargs['pk'])
|
atlas = Case.objects.get(pk=kwargs['pk'])
|
||||||
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.groups.filter(name='atlas_marker').exists() or request.user.is_superuser:
|
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.groups.filter(name='atlas_marker').exists() or request.user.is_superuser:
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
@@ -36,7 +36,7 @@ def user_is_author_or_atlas_checker_or_atlas_marker(function):
|
|||||||
|
|
||||||
def user_is_author_or_atlas_checker(function):
|
def user_is_author_or_atlas_checker(function):
|
||||||
def wrap(request, *args, **kwargs):
|
def wrap(request, *args, **kwargs):
|
||||||
atlas = Atlas.objects.get(pk=kwargs['pk'])
|
atlas = Case.objects.get(pk=kwargs['pk'])
|
||||||
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.is_superuser:
|
if request.user in atlas.author.all() or request.user.groups.filter(name='atlas_checker').exists() or request.user.is_superuser:
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user