-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Return unsafe sharing error from backend #3990
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arikfr
reviewed
Jul 17, 2019
redash/handlers/query_results.py
Outdated
@@ -182,7 +182,12 @@ def post(self, query_id): | |||
if has_access(query, self.current_user, allow_executing_with_view_only_permissions): | |||
return run_query(query.parameterized, parameter_values, query.data_source, query_id, max_age) | |||
else: | |||
return {'job': {'status': 4, 'error': 'You do not have permission to run queries with this data source.'}}, 403 | |||
if current_user.is_api_user() and not query.parameterized.is_safe: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍done in 474dae1
Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
…:getredash/redash into return-unsafe-sharing-error-from-backend
…s to a single location
ranbena
reviewed
Jul 17, 2019
Co-Authored-By: Ran Byron <ranbena@gmail.com>
arikfr
reviewed
Jul 18, 2019
Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
arikfr
approved these changes
Jul 21, 2019
harveyrendell
pushed a commit
to pushpay/redash
that referenced
this pull request
Nov 14, 2019
* return message explaining unsafe sharing * use backend-generated message for public dashboards * use backend-generated message for embeds * Update redash/handlers/query_results.py Co-Authored-By: Arik Fraimovich <arik@arikfr.com> * refactor simple (non-interpolated) query result handler error messages to a single location * use error_messages to test out unsafe error messages (along with a couple of others) * Update redash/handlers/query_results.py Co-Authored-By: Ran Byron <ranbena@gmail.com> * Update redash/handlers/query_results.py Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
Create a message explaining that unsafe queries can't be shared in the backend, and use that message in public dashboards and embeds.
Related Tickets & Documents
Replaces the behavior introduced in #3659 and #3988 (/cc @ranbena)
Mobile & Desktop Screenshots/Recordings (if there are UI changes)