get permissions

Solutions on MaxInterview for get permissions by the best coders in the world

showing results for - "get permissions"
Jannik
13 Sep 2016
1def get_permissions(self):
2    # Your logic should be all here
3    if self.request.method == 'GET':
4        self.permission_classes = [DummyPermission, ]
5    else:
6        self.permission_classes = [IsAuthenticated, ]
7
8    return super(UsersViewSet, self).get_permissions()
9