-
Notifications
You must be signed in to change notification settings - Fork 366
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
Enable use of separate connection for running queries and powering sql-explorer #675
Comments
I am aware of the blacklist functionality, but I would like to implement this protection at the database level if possible. Also, adding |
@WillNilges can you please share the stacktrace? I'd like to see which line in shema.py is throwing the error. Basically, i need to know whether it is If it's the second, I think it's quite fixable and would be happy to make this work. Otherwise...I'd have to think about how to approach it. Solvable I'm sure, but not totally obvious how to do it. Good find. |
Sure thing! Here's what the role has access to:
This, out of the following
Here's what happens when I load up the playground with that role:
Here's the trace when I try to submit a query anyway.
It looks like it's an issue with
|
Ah! Yeah great. Super easy to fix. I’ll see if I can address it tomorrow. I’ll probably forward-fix it in 5.3 and do a final release of that. Lots of good things in that version. Thanks much! |
I'm fixing this now -- but in the meantime you could set
That should do the trick, with no changes to the app itself. |
Fix has been merged into the 5.3 release. |
This might be a bit of an XY problem. I am trying to enable normal users to make read-only (
SELECT
) queries against only the models of my Django database. To accomplish this, I have created a migration to create a read-onlyROLE
in my Postgres DB that only has SELECT privileges on those tables. However, this prevents the explorer from working. The schema preview, autocomplete, and actually running queries results in an error:permission denied for table authtoken_token
.If I allow
SELECT
on the following tables, it works:It's clear that this project is doing stuff on its own with this role. I would like to give it its own role, and then use a separate role for queries, ideally on a per-user basis.
TL;DR: Is there any way to only allow people to run queries on certain tables, without being able to see sensitive tables like
authtoken_token
?The text was updated successfully, but these errors were encountered: