Merge pull request #4517 from emanuelschuetze/fixComments

Fixed permission check for manage comments
This commit is contained in:
Norman Jäckel 2019-03-20 08:47:11 +01:00 committed by GitHub
commit 94080df663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,9 +76,9 @@ class MotionViewSet(TreeSortMixin, ModelViewSet):
result = has_perm(self.request.user, "motions.can_see")
# For partial_update, update and destroy requests the rest of the check is
# done in the update method. See below.
elif self.action in ("create", "set_state"):
elif self.action in ("create", "set_state", "manage_comments"):
result = has_perm(self.request.user, "motions.can_see")
# For create the rest of the check is done in the respective method. See below.
# The rest of the check is done in the respective method. See below.
elif self.action in (
"manage_multiple_state",
"set_recommendation",
@ -91,7 +91,7 @@ class MotionViewSet(TreeSortMixin, ModelViewSet):
result = has_perm(self.request.user, "motions.can_see") and has_perm(
self.request.user, "motions.can_manage_metadata"
)
elif self.action in ("sort", "manage_comments"):
elif self.action == "sort":
result = has_perm(self.request.user, "motions.can_see") and has_perm(
self.request.user, "motions.can_manage"
)