def check_permission(self, request, *args, **kwargs):
        if self.print_all_motions:
            is_allowed = request.user.has_perm('motions.can_see')
        else:
            is_allowed = self.get_object().get_allowed_actions(request.user)['see']
        return is_allowed
Checks if the requesting user has the permission to see the motion as
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/motions/views.py/MotionPDFView.check_permission