8fe5a0c9f4
- 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
31 lines
947 B
Python
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"
|