Skip to content

Commit

Permalink
Fixed Users API Permission Levels
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jul 24, 2020
1 parent a77db38 commit d0520db
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions care/users/api/viewsets/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,25 @@ class UserViewSet(
queryset = User.objects.all().select_related("local_body", "district", "state")
lookup_field = "username"

def get_permissions(self):
return [
DRYPermissions(),
IsAuthenticated(),
]
# if self.request.method == "POST":
# return [
# DRYPermissions(),
# ]
# else:
# return [
# IsAuthenticated(),
# DRYPermissions(),
# ]
permission_classes = (
IsAuthenticated,
DRYPermissions,
)

# def get_permissions(self):
# return [
# DRYPermissions(),
# IsAuthenticated(),
# ]
# if self.request.method == "POST":
# return [
# DRYPermissions(),
# ]
# else:
# return [
# IsAuthenticated(),
# DRYPermissions(),
# ]

def get_serializer_class(self):
if self.action == "list" and not self.request.user.is_superuser:
Expand Down

0 comments on commit d0520db

Please sign in to comment.