.
This commit is contained in:
+4
-1
@@ -73,7 +73,10 @@ def user_is_author_or_atlas_editor(function):
|
||||
|
||||
def user_is_collection_author_or_atlas_editor(function):
|
||||
def wrap(request, *args, **kwargs):
|
||||
atlas = CaseCollection.objects.get(pk=kwargs["pk"])
|
||||
if "exam_id" in kwargs:
|
||||
atlas = CaseCollection.objects.get(pk=kwargs["exam_id"])
|
||||
else:
|
||||
atlas = CaseCollection.objects.get(pk=kwargs["pk"])
|
||||
if (
|
||||
request.user in atlas.author.all()
|
||||
or request.user.groups.filter(name="atlas_editor").exists()
|
||||
|
||||
Reference in New Issue
Block a user