# HG changeset patch # User ymh # Date 1414213186 -7200 # Node ID dafb175c9e8caa9aa13d6f1c69d57755b576ad27 # Parent b50d5f5794629fe663944024df52a1ccb7460ccc Allow authentication to get content info. diff -r b50d5f579462 -r dafb175c9e8c src/ldt/ldt/api/ldt/resources/content.py --- a/src/ldt/ldt/api/ldt/resources/content.py Thu Oct 16 16:18:20 2014 +0200 +++ b/src/ldt/ldt/api/ldt/resources/content.py Sat Oct 25 06:59:46 2014 +0200 @@ -8,6 +8,8 @@ from tastypie import fields from tastypie.resources import Bundle, ModelResource, ALL_WITH_RELATIONS, ALL +from ldt.api.ldt.authentication import (SessionAuthentication, + MultiAuthentication, ApiKeyAuthentication) from ldt.indexation import get_results_list from ldt.ldt_utils.models import Content, Media, Project, Segment from ldt.ldt_utils.projectserializer import ProjectJsonSerializer, ProjectMerger @@ -39,6 +41,7 @@ class Meta: allowed_methods = ['get'] resource_name = 'contents' + authentication = MultiAuthentication(ApiKeyAuthentication(), SessionAuthentication()) queryset = Content.objects.select_related('front_project','media_obj').all() filtering = { 'tags' : ALL_WITH_RELATIONS,