Skip to content

Commit

Permalink
Allow additional submitters update with CAN_MANAGE_METADATA (#2439)
Browse files Browse the repository at this point in the history
* Allow additional submitters update with CAN_MANAGE_METADATA

* Update docs
  • Loading branch information
bastianjoel authored May 28, 2024
1 parent 8e1436f commit c482bfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/actions/motion.update.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ If the request user does not have `motion.can_manage`, the fields in the payload
* `motion_block_id`
* `origin`
* `supporter_meeting_user_ids`
* `additional_submitter`
* `recommendation_extension`
* `start_line_number`
* `workflow_timestamp`
1 change: 1 addition & 0 deletions openslides_backend/action/actions/motion/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def check_permissions(self, instance: dict[str, Any]) -> None:
"category_id",
"block_id",
"supporter_meeting_user_ids",
"additional_submitter",
"recommendation_extension",
"start_line_number",
"tag_ids",
Expand Down
4 changes: 2 additions & 2 deletions openslides_backend/presenter/get_forwarding_committees.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def get_result(self) -> Any:
if not has_perm(
self.datastore,
self.user_id,
Permissions.Motion.CAN_MANAGE,
Permissions.Motion.CAN_MANAGE_METADATA,
self.data["meeting_id"],
):
msg = "You are not allowed to perform presenter get_forwarding_committees"
msg += f" Missing permission: {Permissions.Motion.CAN_MANAGE}"
msg += f" Missing permission: {Permissions.Motion.CAN_MANAGE_METADATA}"
raise PermissionDenied(msg)

meeting = self.datastore.get(
Expand Down
2 changes: 2 additions & 0 deletions tests/system/action/motion/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def test_update_correct_2(self) -> None:
"category_id": 4,
"block_id": 51,
"supporter_meeting_user_ids": [],
"additional_submitter": "additional",
"tag_ids": [],
"attachment_ids": [],
"workflow_timestamp": 9876543210,
Expand All @@ -249,6 +250,7 @@ def test_update_correct_2(self) -> None:
assert model.get("category_id") == 4
assert model.get("block_id") == 51
assert model.get("supporter_meeting_user_ids") == []
assert model.get("additional_submitter") == "additional"
assert model.get("tag_ids") == []
assert model.get("attachment_ids") == []
# motion/113 does not exist and should therefore not be present in the relations
Expand Down

0 comments on commit c482bfb

Please sign in to comment.