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

Saved dashboards currently available to anyone to view #37

Closed
simonw opened this issue Mar 16, 2021 · 1 comment
Closed

Saved dashboards currently available to anyone to view #37

simonw opened this issue Mar 16, 2021 · 1 comment
Labels
bug Something isn't working security

Comments

@simonw
Copy link
Owner

simonw commented Mar 16, 2021

Until full permissions are implemented in #27 this should be considered an urgent bug to fix.

@simonw simonw added bug Something isn't working security labels Mar 16, 2021
@simonw
Copy link
Owner Author

simonw commented Mar 16, 2021

This was a deliberate design decision but I've changed my mind on it:

def test_saved_dashboard(client, admin_client, dashboard_db):
assert client.get("/dashboard/test/").status_code == 404
dashboard = Dashboard.objects.create(slug="test")
dashboard.queries.create(sql="select 11 + 33")
dashboard.queries.create(sql="select 22 + 55")
response = client.get("/dashboard/test/")
assert response.status_code == 200
assert b"44" in response.content
assert b"77" in response.content
# The admin user should get >count< links, but anon should not
assert b">count<" not in response.content
admin_response = admin_client.get("/dashboard/test/")
assert admin_response.status_code == 200
assert b">count<" in admin_response.content

@simonw simonw closed this as completed in 678576c Mar 16, 2021
simonw added a commit that referenced this issue Mar 16, 2021
simonw added a commit to CAVaccineInventory/vial that referenced this issue Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security
Projects
None yet
Development

No branches or pull requests

1 participant