示例#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(),]