Пример #1
0
 def get_permissions(self):
     if self.action == "retrieve":
         return [permissions.IsAuthenticated()]
     elif self.action == "create":
         return [IsSuperUser()]
     elif self.action == "list":
         return [permissions.IsAuthenticated()]
     elif self.action == "update":
         return [IsSuperUser(),permissions.IsAdminUser()]
     elif self.action == "partial_update":
         return [IsSuperUser(),permissions.IsAdminUser()]
     elif self.action == "destroy":
         return [IsSuperUser()]
     else:
         return [permissions.IsAuthenticated()]
Пример #2
0
 def get_permissions(self):
     if self.action == "retrieve":
         return [IsAuthenticated(),IsTicketOwnerOrReadOnly()]
     elif self.action == "create":
         return [IsSuperUser()]
     elif self.action == "list":
         return [IsAuthenticated(),IsTicketOwnerOrReadOnly()]
     elif self.action == "update":
         return [IsTicketOwnerOrReadOnly()]
     elif self.action == "partial_update":
         return [IsTicketOwnerOrReadOnly()]
     elif self.action == "destroy":
         return [IsSuperUser()]
     else:
         return [IsAuthenticated(),IsTicketOwnerOrReadOnly()]
Пример #3
0
 def get_permissions(self):
     return [IsSuperUser(),permissions.IsAdminUser()]
Пример #4
0
 def get_permissions(self):
     return [IsSuperUser(),]