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

Add scopes delete:metadata and delete:data #742

Open
danielballan opened this issue May 10, 2024 · 1 comment
Open

Add scopes delete:metadata and delete:data #742

danielballan opened this issue May 10, 2024 · 1 comment

Comments

@danielballan
Copy link
Member

danielballan commented May 10, 2024

Summarizing a discussion with @dylanmcreynolds


Currently, the deletion routes require write:metadata and write:data Scopes:

entry=SecureEntry(scopes=["write:data", "write:metadata"]),

Let's separate out Scopes for deletion so that Roles and Access Control Policies can enable writing but block deleting if desired. (This issue is not taking a policy on what default/common Scopes should be, only that these should be separated out now so that it is possible to distinguish them.)

Specifically:

  • delete:metadata --- May remove rows from the Catalog database, dropping references to externally-managed data.
  • delete:data --- May delete actual files, internally-managed files that were written by the Tiled server and may be the canonical copy of a given dataset. (Deleting the files should also clean up the SQL entities referencing them.)

We may need to add and/or rename routes:

  • Existing route DELETE /metadata/{path} should change from scopes ["write:metadata", "write:data"] to scopes ["delete:metadata"].
  • Existing route DELETE /nodes/{path} should maybe be split into DELETE /nodes/metadata/{path} (can delete references to externally-managed data, or empty nodes) and DELETE /nodes/assets/{path} (can delete actual data), protected by ["delete:metadata"] and ["delete:metadata", "delete:data"] respectively.
@padraic-shafer
Copy link
Contributor

This sounds reasonable.

@danielballan danielballan added this to the v0.1.0 release milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants