22 lines
698 B
Python
22 lines
698 B
Python
from django.shortcuts import render
|
|
from rest_framework import viewsets
|
|
|
|
from api.logger.mixins import LoggingMixin
|
|
from .models import Task
|
|
from .serializers import TaskSerializer
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
# Create your views here.
|
|
from core.permissions import (
|
|
IsSameOrganization,
|
|
IsSameOrganizationDeveloper,
|
|
IsSameOrganizationAndAdmin,
|
|
IsSuperUser
|
|
)
|
|
|
|
class TaskViewSet(LoggingMixin,viewsets.ModelViewSet):
|
|
permission_classes = [IsAuthenticated & (IsSameOrganization | IsSameOrganizationAndAdmin | IsSameOrganizationDeveloper | IsSuperUser)]
|
|
queryset = Task.objects.all()
|
|
serializer_class = TaskSerializer
|
|
|
|
my_tags = ['tasks'] |