Skip to content
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

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

Closed
simonw opened this issue Feb 9, 2024 · 8 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Feb 9, 2024

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 #22 (comment)

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 simonw added the enhancement New feature or request label Feb 9, 2024
@simonw simonw added this to the 0.8 milestone Feb 9, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 9, 2024

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

  • Leave the existing edit-schema permission in place - it will be a shortcut for allowing all permissions
  • Get rid of the (unreleased) edit-schema-create-table and edit-schema-drop-table permissions, instead looking for create-table and drop-table from core
  • Punt on the alter-table permission. That's going to come from Datasette core but is blocked until 1.0a9 is out.

@simonw
Copy link
Owner Author

simonw commented Feb 9, 2024

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
Copy link
Owner Author

simonw commented Feb 9, 2024

... 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
Copy link
Owner Author

simonw commented Feb 9, 2024

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

@simonw
Copy link
Owner Author

simonw commented Feb 9, 2024

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 simonw changed the title Use Datasette core create-table and drop-table permissions Use Datasette 1.0a9 create-table and drop-table and alter-table permissions Feb 9, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 9, 2024

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

@simonw
Copy link
Owner Author

simonw commented Feb 16, 2024

@simonw
Copy link
Owner Author

simonw commented Feb 16, 2024

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

@simonw simonw closed this as completed Feb 16, 2024
simonw added a commit that referenced this issue Feb 18, 2024
Switch setup.py to pyproject.toml

Refs #22, #45, #46, #47, #49, #50, #51, #52, #53, #54, #55, #56, #57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant