Пример #1
0
    def get_permissions(self):
        if self.request.method in ['GET']:
            return [CanViewParentDictionary(), ]

        if self.request.method == 'DELETE' and self.is_hard_delete_requested():
            return [IsAdminUser(), ]

        return [CanEditParentDictionary(), ]
Пример #2
0
    def get_permissions(self):
        if self.request.method == 'POST':
            return [
                CanEditParentDictionary(),
            ]

        return [
            CanViewParentDictionary(),
        ]
Пример #3
0
    def get_permissions(self):
        if self.request.method in ['GET']:
            return [
                CanViewParentDictionary(),
            ]

        return [
            CanEditParentDictionary(),
        ]