OpenSlides/server/openslides/assignments/access_permissions.py

35 lines
999 B
Python
Raw Normal View History

2019-10-29 09:44:19 +01:00
from ..poll.access_permissions import (
BaseOptionAccessPermissions,
2019-10-29 09:44:19 +01:00
BasePollAccessPermissions,
BaseVoteAccessPermissions,
)
2018-08-22 22:00:08 +02:00
from ..utils.access_permissions import BaseAccessPermissions
class AssignmentAccessPermissions(BaseAccessPermissions):
"""
Access permissions container for Assignment and AssignmentViewSet.
"""
2019-01-06 16:22:33 +01:00
base_permission = "assignments.can_see"
2019-10-18 14:18:49 +02:00
2019-10-29 09:44:19 +01:00
class AssignmentPollAccessPermissions(BasePollAccessPermissions):
2019-10-18 14:18:49 +02:00
base_permission = "assignments.can_see"
manage_permission = "assignments.can_manage"
additional_fields = [
"amount_global_yes",
"amount_global_no",
"amount_global_abstain",
]
2019-10-29 09:00:11 +01:00
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"