Merge pull request #4644 from FinnStutzenstein/noProjectiondefaultChanges

prohibit changes in projectiondefaults
This commit is contained in:
Norman Jäckel 2019-05-08 09:28:08 +02:00 committed by GitHub
commit dd66e7505d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,12 +288,12 @@ class ProjectorViewSet(ModelViewSet):
return Response({"detail": message}) return Response({"detail": message})
class ProjectionDefaultViewSet(ModelViewSet): class ProjectionDefaultViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
""" """
API endpoint for projection defaults. API endpoint for projection defaults.
There are the following views: list, retrieve, create, update, There are the following views: list, and retrieve. Assigning projection defaults
partial_update and destroy. to projectors can be done by updating the projector.
""" """
access_permissions = ProjectionDefaultAccessPermissions() access_permissions = ProjectionDefaultAccessPermissions()
@ -305,8 +305,6 @@ class ProjectionDefaultViewSet(ModelViewSet):
""" """
if self.action in ("list", "retrieve"): if self.action in ("list", "retrieve"):
result = self.get_access_permissions().check_permissions(self.request.user) result = self.get_access_permissions().check_permissions(self.request.user)
elif self.action in ("create", "partial_update", "update", "destroy"):
result = has_perm(self.request.user, "core.can_manage_projector")
else: else:
result = False result = False
return result return result