Esempio n. 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()]
Esempio n. 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()]
Esempio n. 3
0
 def get_permissions(self):
     return [IsSuperUser(),permissions.IsAdminUser()]
Esempio n. 4
0
 def get_permissions(self):
     return [IsSuperUser(),]