예제 #1
0
 class Meta:
     queryset = Team.objects.all()
     list_allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(organization__id__in=u.teams.all().values(
             'organization__id').distinct()),
         lambda u: Q(organization__id__in=u.teams.filter(
             access_type="admin").values('organization__id').distinct()))
예제 #2
0
 class Meta:
     queryset = Iteration.objects.all()
     fields = ['id', 'name', 'start_date', 'end_date', 'project_id']
     list_allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(project__teams__in=u.teams.all()) | Q(
             project__member_users__in=[u]),
         lambda u: Q(project__teams__in=u.teams.filter(
             Q(access_type="read/write") | Q(access_type="admin"))) | Q(
                 project__member_users__in=[u]))
예제 #3
0
 class Meta:
     queryset = Task.objects.all()
     fields = ['id', 'summary', 'complete', 'order']
     list_allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(story__project__teams__in=u.teams.all()) | Q(
             story__project__member_users__in=[u]),
         lambda u: Q(story__project__teams__in=u.teams.filter(
             Q(access_type="read/write") | Q(access_type="admin"))) | Q(
                 story__project__member_users__in=[u]))
예제 #4
0
 class Meta:
     queryset = Project.objects.all()
     fields = [
         'name', 'slug', 'creator_id', 'organization_id', 'velocity',
         'iterations_left', 'get_num_stories'
     ]
     list_allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(teams__in=u.teams.all()) | Q(member_users__in=[u]),
         lambda u: Q(teams__in=u.teams.filter(
             Q(access_type="read/write") | Q(access_type="admin"))) | Q(
                 member_users__in=[u]))
예제 #5
0
 class Meta:
     queryset = Epic.objects.all()
     fields = [
         'id', 'summary', 'detail', 'points', 'project_id', 'parent_id',
         'status', 'order', 'archived', 'local_id'
     ]
     list_allowed_methods = ['get', 'post', 'put', 'delete']
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(project__teams__in=u.teams.all()) | Q(
             project__member_users__in=[u]),
         lambda u: Q(project__teams__in=u.teams.filter(
             Q(access_type="read/write") | Q(access_type="admin"))) | Q(
                 project__member_users__in=[u]))
예제 #6
0
 class Meta:
     queryset = Story.objects.all()
     fields = [
         'id', 'summary', 'detail', 'assignee_id', 'points', 'iteration_id',
         'project_id', 'status', 'extra_1', 'extra_2', 'extra_3'
     ]
     list_allowed_methods = []
     authentication = ScrumDoAuthentication()
     authorization = ScrumDoAuthorization(
         lambda u: Q(project__teams__in=u.teams.all()) | Q(
             project__member_users__in=[u]),
         lambda u: Q(project__teams__in=u.teams.filter(
             Q(access_type="read/write") | Q(access_type="admin"))) | Q(
                 project__member_users__in=[u]))
예제 #7
0
 class Meta:
     queryset = User.objects.all()
     fields = ['username', 'first_name', 'last_name', 'last_login']
     detail_allowed_methods = ['get']
     list_allowed_methods = []
     authentication = ScrumDoAuthentication()
예제 #8
0
 class Meta:
     fields = ['created', 'text', 'icon', 'user']
     resource_name = "news"
     queryset = NewsItem.objects.all()
     authentication = ScrumDoAuthentication()
예제 #9
0
 class Meta:
     queryset = Activity.objects.all()
     authentication = ScrumDoAuthentication()