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