.
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ from django.core.exceptions import PermissionDenied
|
||||
class AuthorOrCheckerRequiredMixin(object):
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super().get_object(*args, **kwargs)
|
||||
if self.request.user.groups.filter(name="physics_checker").exists():
|
||||
if self.request.user.groups.filter(name="sbas_checker").exists():
|
||||
return obj
|
||||
if self.request.user not in obj.author.all():
|
||||
raise PermissionDenied() # or Http404
|
||||
|
||||
Reference in New Issue
Block a user