Skip to content

Respect PUT semantics in role and permission API #1080

@Firgrep

Description

@Firgrep

🚀 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions