Design for the datasette-public plugin is as follows:
On startup, create a _public_tables database table if one is missing. This has a single text column that is the name of a table.
Add a UI and cog-menu options for making a table public. These are made available by a new permission check.
If possible, a note that the table is public on the table page would be useful too. That might need an extra plugin mechanism to allow for adding custom output to the table page without replacing the template completely though.
Implement permission_allowed to allow access to tables that are marked public
Need to decide what to do about execute_sql - maybe datasette-public disables that entirely for logged-out users, and there's a plugin configuration setting you can use to change that decision?
Design for the
datasette-public
plugin is as follows:_public_tables
database table if one is missing. This has a singletext
column that is the name of a table.permission_allowed
to allow access to tables that are marked publicdatasette-public
disables that entirely for logged-out users, and there's a plugin configuration setting you can use to change that decision?