@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, id_rule):
        # FIXME: Requirement for this whole API hook is wrong.
        # Tags should be got with document metadata. Not with a separate reequest.
        try:
            operator = PluginsOperator()
            mapping = operator.get_plugin_mapping_by_docrule_id(id_rule)
            docrule = mapping.get_docrule()
            tags = TagsPlugin().get_all_tags(docrule=docrule)
            log.info('TagsHandler.read request fulfilled for rule %s' % id_rule)
            return Response(json.dumps(tags), status=status.HTTP_200_OK)
        except Exception, e:  # FIXME
            log.error('TagsHandler.read Exception %s' % e)
            if settings.DEBUG:
                raise
            else:
                return Response(status=status.HTTP_400_BAD_REQUEST)
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/api/views.py/TagsHandler.get/original