We want have a limit to the number of records the users can download from a single query result. I completely agree that the API would still return a JSON representation of the data so the user could get the data after some effort or maybe just copy and paste from the screen.

Not sure if most of the users would bother to take the extra effort. Thougths?

What’s the use-case for this?

Use-Case: Prevent users from readily downloading large number of records.

I wonder if this is the right solution to that problem.

Data visibility is the entire point of Redash. There is an obvious need to completely restrict users from accessing some data (financials, payroll files, health info etc.). But apart from performance concerns, restricting the download size (without also restricting the query result size) is just odd. It sounds like a software solution to a training problem.

Like you mentioned, it won’t stop a determined person from stealing data. But it will overcomplicate legitimate use-cases. Especially considering that Redash queries which return large numbers of records (10k+) are exactly the ones that should be downloaded in Excel! Results that size are simply too big to be visualised in Redash.

Here are a few other ways to reach the same target:

  • Create two data source connections + groups: one for visualising queries and one for making “extracts”. Trusted users have Full Access to both groups. But untrusted users have “View Only” access to the “visualising” group. This way they can view dashboards and small amounts of data but can’t write their own queries.
  • If you don’t need extracts for anything, modify your query runner to append a LIMIT 500 or LIMIT 2000 at the end of each query.
  • Add an option to disable downloads completely either by query or by group. And potentially add logic that obscures API requests to make it harder to bypass this restriction

Cool, thank you for your thoughts.

This is very easy to do with a few lines of code.
I implemented the ability to set the number of lines downloaded to a given group to be unlimited, and then to limit the number of lines downloaded to other users

1 Like