OpenSlides/openslides/assignments/access_permissions.py
Sean Engelhardt 8fe5a0c9f4 Rework assignment voting
- Remove "assignments.can_manage_polls" permission
- Let the client handle some user errors
- Add a send button to manually submit polls
- Show a hint that the user already submitted a vote
  - will not (and should not) work for non-nominal voting
- submitting a vote cannot be changed anymore
  - user will have to confirm sending
- enable deselecting YNA-votings
- nomainal voting will behace the same as non nominal voting
- submitting empty votes should be possible

Perhaps server side adjustments might still be required
2020-03-17 07:24:48 +01:00

31 lines
947 B
Python

from ..poll.access_permissions import (
BaseOptionAccessPermissions,
BasePollAccessPermissions,
BaseVoteAccessPermissions,
)
from ..utils.access_permissions import BaseAccessPermissions
class AssignmentAccessPermissions(BaseAccessPermissions):
"""
Access permissions container for Assignment and AssignmentViewSet.
"""
base_permission = "assignments.can_see"
class AssignmentPollAccessPermissions(BasePollAccessPermissions):
base_permission = "assignments.can_see"
manage_permission = "assignments.can_manage"
additional_fields = ["amount_global_no", "amount_global_abstain"]
class AssignmentOptionAccessPermissions(BaseOptionAccessPermissions):
base_permission = "assignments.can_see"
manage_permission = "assignments.can_manage"
class AssignmentVoteAccessPermissions(BaseVoteAccessPermissions):
base_permission = "assignments.can_see"
manage_permission = "assignments.can_manage"