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

Overhaul Upserts in 4.x #1509

Open
zachdaniel opened this issue Oct 10, 2024 · 0 comments
Open

Overhaul Upserts in 4.x #1509

zachdaniel opened this issue Oct 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@zachdaniel
Copy link
Contributor

Upserts are currently very "dumb", insofar as they do not apply any action logic. From a conceptual standpoint, however, they can and should be modeled as a "create or read and update" operation. To accomplish this, the following changes would be made:

Introduction of four new options:

  • upsert_read_action - defaults to primary read
  • upsert_update_action - defaults to primary update
  • authorize_upsert_read - defaults to true
  • authorize_upsert_update - defaults to true

If authorizing the read, then the authorization rules of the primary read will be applied to changeset.filter.
If authorizing the update, then the authorization rules of the update will be applied to changeset.filter, using error(...) to produce a forbidden error in data layers that support it.

@zachdaniel zachdaniel added enhancement New feature or request needs review and removed needs review labels Oct 10, 2024
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
Status: Someday
Development

No branches or pull requests

1 participant