diff --git a/greenmine/documents/api.py b/greenmine/documents/api.py index fd06ed33..f0c23241 100644 --- a/greenmine/documents/api.py +++ b/greenmine/documents/api.py @@ -1,8 +1,13 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.documents.models import * class DocumentResource(ModelResource): class Meta: queryset = Document.objects.all() resource_name = 'document' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() diff --git a/greenmine/profile/api.py b/greenmine/profile/api.py index 543d576f..3986ca0b 100644 --- a/greenmine/profile/api.py +++ b/greenmine/profile/api.py @@ -1,8 +1,13 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.profile.models import * class ProfileResource(ModelResource): class Meta: queryset = Profile.objects.all() resource_name = 'profile' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() diff --git a/greenmine/questions/api.py b/greenmine/questions/api.py index 3efde08b..3c0b61c5 100644 --- a/greenmine/questions/api.py +++ b/greenmine/questions/api.py @@ -1,13 +1,20 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.questions.models import * class QuestionResource(ModelResource): class Meta: queryset = Question.objects.all() resource_name = 'question' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class QuestionResponseResource(ModelResource): class Meta: queryset = QuestionResponse.objects.all() resource_name = 'questionresponse' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() diff --git a/greenmine/scrum/api.py b/greenmine/scrum/api.py index ae2af2b7..31416a58 100644 --- a/greenmine/scrum/api.py +++ b/greenmine/scrum/api.py @@ -1,38 +1,55 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.scrum.models import * class ProjectResource(ModelResource): class Meta: queryset = Project.objects.all() resource_name = 'project' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class ProjectUserRoleResource(ModelResource): class Meta: queryset = ProjectUserRole.objects.all() resource_name = 'projectuserrole' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class MilestoneResource(ModelResource): class Meta: queryset = Milestone.objects.all() resource_name = 'milestone' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class UserStoryResource(ModelResource): class Meta: queryset = UserStory.objects.all() resource_name = 'userstory' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class ChangeResource(ModelResource): class Meta: queryset = Change.objects.all() resource_name = 'change' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class ChangeAttachmentResource(ModelResource): class Meta: queryset = ChangeAttachment.objects.all() resource_name = 'changeattachment' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class TaskResource(ModelResource): class Meta: queryset = Task.objects.all() resource_name = 'task' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() diff --git a/greenmine/taggit/api.py b/greenmine/taggit/api.py index ca369765..167a52f8 100644 --- a/greenmine/taggit/api.py +++ b/greenmine/taggit/api.py @@ -1,13 +1,20 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.taggit.models import * class TagResource(ModelResource): class Meta: queryset = Tag.objects.all() resource_name = 'tag' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class TaggedItemResource(ModelResource): class Meta: queryset = TaggedItem.objects.all() resource_name = 'taggeditem' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() diff --git a/greenmine/wiki/api.py b/greenmine/wiki/api.py index 7355bac9..0814e5c1 100644 --- a/greenmine/wiki/api.py +++ b/greenmine/wiki/api.py @@ -1,20 +1,29 @@ # myapp/api.py from tastypie.resources import ModelResource +from tastypie.authentication import SessionAuthentication +from tastypie.authorization import DjangoAuthorization + from greenmine.wiki.models import * class WikiPageResource(ModelResource): class Meta: queryset = WikiPage.objects.all() resource_name = 'wikipage' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class WikiPageHistoryResource(ModelResource): class Meta: queryset = WikiPageHistory.objects.all() resource_name = 'wikipagehistory' + authentication = SessionAuthentication() + authorization = DjangoAuthorization() class WikiPageAttachmentResource(ModelResource): class Meta: queryset = WikiPageAttachment.objects.all() resource_name = 'wikipageattachment' + authentication = SessionAuthentication() + authorization = DjangoAuthorization()