2019-10-29 09:44:19 +01:00
|
|
|
from ..poll.access_permissions import (
|
2019-11-12 18:30:26 +01:00
|
|
|
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
|
2016-02-11 22:58:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
class AssignmentAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions container for Assignment and AssignmentViewSet.
|
|
|
|
"""
|
2019-01-06 16:22:33 +01:00
|
|
|
|
|
|
|
base_permission = "assignments.can_see"
|
2016-02-11 11:29:19 +01:00
|
|
|
|
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"
|
2020-03-09 16:40:35 +01:00
|
|
|
manage_permission = "assignments.can_manage"
|
2020-11-23 18:37:00 +01:00
|
|
|
additional_fields = [
|
|
|
|
"amount_global_yes",
|
|
|
|
"amount_global_no",
|
|
|
|
"amount_global_abstain",
|
|
|
|
]
|
2019-10-29 09:00:11 +01:00
|
|
|
|
|
|
|
|
2019-11-12 18:30:26 +01:00
|
|
|
class AssignmentOptionAccessPermissions(BaseOptionAccessPermissions):
|
|
|
|
base_permission = "assignments.can_see"
|
|
|
|
manage_permission = "assignments.can_manage"
|
|
|
|
|
|
|
|
|
2019-10-29 12:58:37 +01:00
|
|
|
class AssignmentVoteAccessPermissions(BaseVoteAccessPermissions):
|
|
|
|
base_permission = "assignments.can_see"
|
|
|
|
manage_permission = "assignments.can_manage"
|