-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
allow_by_query setting for configuring permissions with a SQL statement #801
Comments
Now that I'm expanding permission checks to everything else too (#811), not just canned queries, I think it makes sense to re-prioritize this. |
I'm going to pass the entire actor object as a dictionary of available named query parameters. So if the actor looks like this: {
"id": "simonw",
"roles": ["staff", "developer"]
} Then the SQL query will be called like this: conn.execute(sql, {
"id": "simonw",
"roles: '["staff", "developer"]',
}) |
I'm going to call this key |
Example. This will only allow users to access the {
"databases": {
"fixtures": {
"allow_by_query": "select * from users where id = :id and admin = 1"
}
}
} |
Dropping this out of Datasette 0.44 again - I have enough other stuff to finish, this can wait. |
I've implemented this in a plugin instead: https://github.com/simonw/datasette-permissions-sql |
Originally posted by @simonw in #698 (comment)
See also #800
The text was updated successfully, but these errors were encountered: