def check_view_permissions(self):
        if self.action == 'retrieve':
            result = self.get_access_permissions().can_retrieve(self.request.user)
        else:
            # We do not want anonymous users to use the chat even the anonymous
            # group has the permission core.can_use_chat.
            result = (
                self.action in ('metadata', 'list', 'create') and
                self.request.user.is_authenticated() and
                self.request.user.has_perm('core.can_use_chat'))
        return result
Returns True if the user has required permissions.
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/core/views.py/ChatMessageViewSet.check_view_permissions