I created a query with parameters (eg: SELECT 'test' WHERE 1 = {{parameter}}) and an user without full access to the datasource can not use this new query.
As I am not sure if this is already addressed in newer versions, I am reporting it on this forum instead of creating a new issue on Jira.
Steps to Reproduce the Problem:
Login as an user with full access to a given MySQL datasource
Create a query that uses parameters based on this datasource (eg: SELECT 'test' WHERE 1 = {{parameter}})
Add the query to a dashboard
Login as an user with only access to the given MySQL datasource
Now try to access the dashboard / apply filters to the query
A message “Error running query: You do not have permission to run queries with this data source.” will be shown.
The expected behavior would be the read only user to be able to run this query. OR a new permission would be created to let users run queries changing parameters values without changing queries code.
Technical details:
Redash Version: 0.11.1 + b2095
Browser / OS: Google Chrome, Windows 7
How did you install Redash: not sure, it was already installed
I have encountered the same problem in v1.0.1+b2833.
Users in a group which has View Only access to its data source cannot view the query result,
showing ‘Error running query: You do not have permission to run queries with this data source’.
I have the same issue for queries with parameters( select * from test where {{parameter_name}}=1 ) for View Only access users.
It displays the error “Error running query: You do not have permission to run queries with this data source.” for queries with parameters.
Does anybody found the way how to avoid that issue?
I’m using Redash 4 here and facing the same issue. I’ve found the line of code (https://github.com/getredash/redash/blob/master/redash/handlers/query_results.py#119) responsible for this error message and it really requires that the current user has full access to the data source (please note “not_view_only” as the last parameter):
if not has_access(data_source.groups, self.current_user, not_view_only):
return {‘job’: {‘status’: 4, ‘error’: ‘You do not have permission to run queries with this data source.’}}, 403
I don’t know if this is intended to work as is or it’s a bug…