📜  get_permissions - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:31.476000             🧑  作者: Mango

代码示例1
def get_permissions(self):
    # Your logic should be all here
    if self.request.method == 'GET':
        self.permission_classes = [DummyPermission, ]
    else:
        self.permission_classes = [IsAuthenticated, ]

    return super(UsersViewSet, self).get_permissions()