OpenSlides/openslides/assignments/access_permissions.py
2016-03-06 14:22:40 +01:00

19 lines
606 B
Python

class AccessPermissions:
def get_serializer_class(self, user):
"""
Returns different serializer classes according to users permissions.
"""
from openslides.assignments.serializers import AssignmentFullSerializer, AssignmentShortSerializer
if user.has_perm('assignments.can_manage'):
serializer_class = AssignmentFullSerializer
else:
serializer_class = AssignmentShortSerializer
return serializer_class
def can_retrieve(self, user):
"""
TODO
"""
return user.has_perm('agenda.can_see')