{"html_url": "https://github.com/simonw/datasette/issues/1152#issuecomment-754285588", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1152", "id": 754285588, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NDI4NTU4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-04T23:34:30Z", "updated_at": "2021-01-04T23:34:30Z", "author_association": "OWNER", "body": "I think the way to do this is to have a new plugin hook that returns two SQL where clauses: one returning a list of resources that the user should be able to access (the allow-list) and one returning a list of resources they are explicitly forbidden from accessing (the deny-list). Either of these can be blank.\r\n\r\nDatasette can then combine those into a full SQL query and use it to answer the question \"show me a list of resources that the user is allowed to perform action X on\". It can also answer the existing question, \"is user X allowed to perform action Y on resource Z\"?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 770598024, "label": "Efficiently calculate list of databases/tables a user can view"}, "performed_via_github_app": null}