simonw / datasette-edit-schema

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

Use Datasette 1.0a9 `create-table` and `drop-table` and `alter-table` permissions #55

Closed simonw closed 8 months ago

simonw commented 9 months ago

In #22 I added edit-schema-create-table and edit-schema-drop-table permissions, forgetting that these already existed in Datasette core:

I added the Datasette core create-table and drop-table permissions in November 2022:

Originally posted by @simonw in https://github.com/simonw/datasette-edit-schema/issues/22#issuecomment-1935167139

edit-schema-alter-table is harder, because Datasette only just got that permission today and it's not available in a release yet (it's not in 1.0a8).

simonw commented 9 months ago

Decision: for the next 0.8 release of this plugin I will do the following:

simonw commented 9 months ago

It's actually really hard to support just drop-table without alter-table because the plugin is currently designed to bundle all the features together on the one page, with no way of allowing access to the "edit schema" page if all you should see on that page is the drop table button.

As such I'm going to require edit-schema in order to use the drop feature.

simonw commented 9 months ago

... but that doesn't make much sense, because the whole point of the finely grained permissions project was to help administrators set it so that users could alter a table but not actually drop it.

simonw commented 9 months ago

Maybe I should block this work on a Datasette 1.0a9 release. https://github.com/simonw/datasette/milestone/31

simonw commented 9 months ago

But... if this plugin depends on those permissions in core, what about Datasette 0.x?

I think that continues to use the existing permission. The documentation will need to explain this.

simonw commented 9 months ago

I'm going to ship Datasette1.0a9 and then release 0.8 of this plugin using those core permissions.

simonw commented 8 months ago

1.0a9 is out now: https://docs.datasette.io/en/latest/changelog.html#a9-2024-02-16

simonw commented 8 months ago

I'll continue to support edit-schema as a parent permission for everything else, mainly to avoid breaking existing deployments.