Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot view dashboards as an anonymous user in 0.11 #1319

Closed
Rapsutin opened this issue Oct 11, 2016 · 4 comments
Closed

Cannot view dashboards as an anonymous user in 0.11 #1319

Rapsutin opened this issue Oct 11, 2016 · 4 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@Rapsutin
Copy link
Contributor

Rapsutin commented Oct 11, 2016

When viewing the dashboard
dash_edit_perm = check_ownership(dash, raise_if_false=False)
https://github.com/airbnb/caravel/blob/master/caravel/views.py#L1647
is called

and inside check_ownership
orig_obj.created_by.username == g.user.username):
https://github.com/airbnb/caravel/blob/master/caravel/views.py#L148

is called, but an anonymous user has no username so it raises an exception.

@xrmx xrmx added the !deprecated-label:bug Deprecated label - Use #bug instead label Oct 11, 2016
@xrmx
Copy link
Contributor

xrmx commented Oct 11, 2016

Care to cook a patch? Adding this at the top of the function should do it:

 if g.user.is_anonymous():
    return False

@Rapsutin
Copy link
Contributor Author

I'll try.

@Rapsutin
Copy link
Contributor Author

The change is breaking some tests. I wrote a test for the bug and it seems to work fine, but some other tests are failing now. Looking into it a bit later.

@xrmx
Copy link
Contributor

xrmx commented Oct 11, 2016

Fixed in 1e6e144 . Thanks again!

@xrmx xrmx closed this as completed Oct 11, 2016
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
Co-authored-by: Roman Fedyna <r.fedyna@reply.it>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
Co-authored-by: Roman Fedyna <r.fedyna@reply.it>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
Co-authored-by: Roman Fedyna <r.fedyna@reply.it>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Co-authored-by: Roman Fedyna <r.fedyna@reply.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

No branches or pull requests

2 participants