simonw / datasette-edit-schema

Datasette plugin for modifying table schemas
Apache License 2.0
16 stars 0 forks source link

Check for "edit-tables" permission #9

Closed simonw closed 3 years ago

simonw commented 4 years ago

Like in https://github.com/simonw/datasette-configure-fts/issues/3

simonw commented 3 years ago

This permission should take the current database and table into account, so administrators can configure permission for specific users to edit tables only within a specific database (or limit them to editing specific columns).

Import to consider what this means for table renaming - if you only have permission to edit one specific table you should not be able to rename it. Refs #19.

simonw commented 3 years ago

I'd like to include a mechanism for setting permissions in the plugin configuration, using an "allow" block - and code similar to the default Datasette permissions code in https://github.com/simonw/datasette/blob/448d13ea6b15a9c5c9165a4f6049d073f1524a5e/datasette/default_permissions.py

I may apply the same pattern to other plugins such as datasette-upload-csvs if I like it.

simonw commented 3 years ago

For the first version I'm just going to have a global permission, with no resource checks.

simonw commented 3 years ago

Split out advanced permissions stuff into separate issues. This is good enough for the 0.3 milestone.