Skip to content

Commit

Permalink
Apply the negation only to anonymous user and not whether the view.ac…
Browse files Browse the repository at this point in the history
…tion is list.

Signed-off-by: Njagi Mwaniki <[email protected]>
  • Loading branch information
urbanslug committed Feb 13, 2017
1 parent f695509 commit 5279e48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onadata/apps/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def has_permission(self, request, view):
# To allow individual public dataviews to be visible on
# `api/v1/dataviews/<pk>` but stop retreival of all dataviews when
# the dataviews endpoint is queried `api/v1/dataviews`
return not (request.user.is_anonymous() and view.action == 'list')
return not request.user.is_anonymous() and view.action == 'list'

def has_object_permission(self, request, view, obj):
model_cls = Project
Expand Down

0 comments on commit 5279e48

Please sign in to comment.