Allow authentication to get content info.
authorymh <ymh.work@gmail.com>
Sat, 25 Oct 2014 06:59:46 +0200
changeset 1331 dafb175c9e8c
parent 1330 b50d5f579462
child 1333 c59a51cf2dda
Allow authentication to get content info.
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,