2016-02-11 22:58:32 +01:00
|
|
|
from ..utils.access_permissions import BaseAccessPermissions
|
|
|
|
|
2016-02-11 11:29:19 +01:00
|
|
|
|
2016-02-11 22:58:32 +01:00
|
|
|
class ProjectorAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions container for Projector and ProjectorViewSet.
|
|
|
|
"""
|
2018-11-01 17:30:18 +01:00
|
|
|
base_permission = 'core.can_see_projector'
|
2016-02-11 22:58:32 +01:00
|
|
|
|
2016-03-02 00:46:19 +01:00
|
|
|
def get_serializer_class(self, user=None):
|
2016-02-11 22:58:32 +01:00
|
|
|
"""
|
|
|
|
Returns serializer class.
|
|
|
|
"""
|
|
|
|
from .serializers import ProjectorSerializer
|
|
|
|
|
|
|
|
return ProjectorSerializer
|
|
|
|
|
|
|
|
|
|
|
|
class TagAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions container for Tag and TagViewSet.
|
|
|
|
"""
|
|
|
|
|
2016-03-02 00:46:19 +01:00
|
|
|
def get_serializer_class(self, user=None):
|
2016-02-11 22:58:32 +01:00
|
|
|
"""
|
|
|
|
Returns serializer class.
|
|
|
|
"""
|
|
|
|
from .serializers import TagSerializer
|
|
|
|
|
|
|
|
return TagSerializer
|
|
|
|
|
|
|
|
|
|
|
|
class ChatMessageAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions container for ChatMessage and ChatMessageViewSet.
|
|
|
|
"""
|
2018-11-01 17:30:18 +01:00
|
|
|
base_permission = 'core.can_use_chat'
|
2016-02-11 22:58:32 +01:00
|
|
|
|
2016-03-02 00:46:19 +01:00
|
|
|
def get_serializer_class(self, user=None):
|
2016-02-11 22:58:32 +01:00
|
|
|
"""
|
|
|
|
Returns serializer class.
|
|
|
|
"""
|
|
|
|
from .serializers import ChatMessageSerializer
|
|
|
|
|
|
|
|
return ChatMessageSerializer
|
|
|
|
|
|
|
|
|
2016-10-21 11:05:24 +02:00
|
|
|
class ProjectorMessageAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions for ProjectorMessage.
|
|
|
|
"""
|
2018-11-01 17:30:18 +01:00
|
|
|
base_permission = 'core.can_see_projector'
|
2016-10-21 11:05:24 +02:00
|
|
|
|
|
|
|
def get_serializer_class(self, user=None):
|
|
|
|
"""
|
|
|
|
Returns serializer class.
|
|
|
|
"""
|
|
|
|
from .serializers import ProjectorMessageSerializer
|
|
|
|
|
|
|
|
return ProjectorMessageSerializer
|
|
|
|
|
|
|
|
|
|
|
|
class CountdownAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions for Countdown.
|
|
|
|
"""
|
2018-11-01 17:30:18 +01:00
|
|
|
base_permission = 'core.can_see_projector'
|
2016-10-21 11:05:24 +02:00
|
|
|
|
|
|
|
def get_serializer_class(self, user=None):
|
|
|
|
"""
|
|
|
|
Returns serializer class.
|
|
|
|
"""
|
|
|
|
from .serializers import CountdownSerializer
|
|
|
|
|
|
|
|
return CountdownSerializer
|
|
|
|
|
|
|
|
|
2016-02-11 22:58:32 +01:00
|
|
|
class ConfigAccessPermissions(BaseAccessPermissions):
|
|
|
|
"""
|
|
|
|
Access permissions container for the config (ConfigStore and
|
|
|
|
ConfigViewSet).
|
|
|
|
"""
|
|
|
|
|
2017-08-22 14:17:20 +02:00
|
|
|
def get_serializer_class(self, user=None):
|
2016-02-11 22:58:32 +01:00
|
|
|
"""
|
2017-08-22 14:17:20 +02:00
|
|
|
Returns serializer class.
|
2016-02-11 22:58:32 +01:00
|
|
|
"""
|
2017-08-22 14:17:20 +02:00
|
|
|
from .serializers import ConfigSerializer
|
2016-02-11 22:58:32 +01:00
|
|
|
|
2017-08-22 14:17:20 +02:00
|
|
|
return ConfigSerializer
|