@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):
        # Catch get with no payload
        docrule_id = request.GET.get('docrule_id', None)
        if not docrule_id:
            log.error('MetaDataTemplateHandler.read attempted with no payload.')
            return Response([])

        log.debug('MetaDataTemplateHandler.read underway with docrule_id %s.' % docrule_id)

        # Retrieve MDT from docrule_id
        manager = MetaDataTemplateManager()
        result = manager.get_mdts_for_docrule(docrule_id)

        log.debug('MetaDataTemplateHandler.read result: %s.' % result)

        if not result:
            log.error('MetaDataTemplateHandler.read error with docrule_id %s' % docrule_id)
            return Response(status=status.HTTP_404_NOT_FOUND)

        log.info('MetaDataTemplateHandler.read request fulfilled for docrule_id %s' % docrule_id)
        return Response(result, status=status.HTTP_200_OK)
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/api/views.py/MetaDataTemplateHandler.get/original