@method_decorator(logged_in_or_basicauth(AUTH_REALM))
    @method_decorator(group_required(API_GROUP_NAME))  # FIXME: Should be more granular permissions
    def get(self, request, code=None, suggested_format=None):
        if not code:
            return Response([])
        revision, hashcode, extra = self._get_info(request)
        processor = DocumentProcessor()
        options = {
            'hashcode': hashcode,
            'revision': revision,
            'extension': suggested_format,
            'user': request.user,
        }
        document = processor.read(code, options)
        if not request.user.is_superuser:
            # Hack: Used part of the code from MDTUI Wrong!
            user_permissions = list_permitted_docrules_qs(request.user)
            if not document.docrule in user_permissions:
                return Response(status=status.HTTP_401_UNAUTHORIZED)
        if processor.errors:
            log.error('FileHandler.read manager errors: %s' % processor.errors)
            return Response(status=status.HTTP_404_NOT_FOUND)
        if document.marked_deleted:
            log.error('FileHandler.read request to marked deleted document: %s' % code)
            return Response(status=status.HTTP_404_NOT_FOUND)
        else:
            response = DMSObjectResponse(document)
            log.info('FileHandler.read request fulfilled for code: %s, options: %s' % (code, options))
        return response
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/api/views.py/FileHandler.get/original