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

Respect PUT semantics in role and permission API #1080

Open
Firgrep opened this issue Dec 19, 2024 · 0 comments
Open

Respect PUT semantics in role and permission API #1080

Firgrep opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Firgrep
Copy link

Firgrep commented Dec 19, 2024

🚀 Feature

https://supertokens.com/docs/userroles/managing-roles-and-permissions

Semantically, PUT should update the entire resource, but the current implementation behaves more like PATCH (partially updating the resource).

If I PUT to recipe/role with a new role and 10 permissions, it gets created with those permissions. But if I change the permissions, adding a few new ones and removing others, run the request again to the same role, the new ones are added but the others are not removed. One would expect that the resource is entirely replaced.

Please make PUT so that it replaces the resource, and set the current functionality under a new PATCH method.

  • This would accord with expected HTTP semantics.
  • This would help developers managing roles programmatically, as one wouldn't need a whole logic that fetches and verifies permissions.

Implementation details

(Please outline any details about how this feature would e implemented. If you don't know, you can just skip this
section.)

@Firgrep Firgrep added the enhancement New feature or request label Dec 19, 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
None yet
Development

No branches or pull requests

1 participant