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

Permissions for dropdown values of parameters should be governed by query's ACL #3467

Closed
arikfr opened this issue Feb 19, 2019 · 2 comments
Closed

Comments

@arikfr
Copy link
Member

arikfr commented Feb 19, 2019

Currently to be able to load data for dropdown values you need read access to the data source these values came from. This goes against our current plan of allowing anyone with access to the query to be able to interact with it.

Based on the above, we should change the way we assert permissions for dropdown values to allow access if the user has access to the query which uses them.

This means the API should change to something like:

/api/queries/<parameterized query id>/dropdowns

And there we should look up all the relevant queries and return needed values.

Of course that's just one idea.

@rauchy
Copy link
Contributor

rauchy commented Mar 6, 2019

I've been playing around with this and I tend to think we would need a dedicated endpoint for query-based dropdowns used in embeds and public dashboards. The reason is that dropdown values will be obtained in 3 different situations:

  1. At the time a user is creating the query and setting up parameters - the dropdown query is not yet associated with the parent query (and the parent query might not even be persisted yet). In this case, there's no way to find an association between the two queries and you just need to be able to directly access the dropdown query.
  2. When validating parameters - this happens server-side and we already made sure there is an association between the parent query and the dropdown query when the query was created.
  3. After an embed (or dashboard) is created and shared - then, a (non-logged-in) user should be able to select from the dropdown values and for that we would need something like /api/queries/:parent_query_id/dropdowns/:dropdown_query_id

Let me know if you have any thoughts on this.

@arikfr
Copy link
Member Author

arikfr commented Mar 6, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants