p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
418 stars 72 forks source link

Organization roles API improvement #97

Closed Reavolt closed 9 months ago

Reavolt commented 1 year ago

Faced such a problem that when performing a request to assign a specific role in an organization to a user, I can only assign 1 role per 1 request. Which doesn't look very comfortable. I would like to be able to issue and create a set of roles.

https://phasetwo.io/api/create-organization-role https://phasetwo.io/api/grant-user-organization-role

xgp commented 1 year ago

Happy to accept a PR in this regard. I haven't looked at the Keycloak Admin API to see if they've established a standard we could follow for bulk adding of roles, but it would certainly be a nice addition.

farafonov-alexey commented 1 year ago

Hello! Can you review #99 for this, please)

xgp commented 1 year ago

Hello! Can you review #99 for this, please)

Yes. I’ll also need to run a few additional regression tests before a merge, so this will take a few days. Thank you for the PR!

Reavolt commented 1 year ago

@xgp Hello, is there any progress on this PR?

xgp commented 1 year ago

@Reavolt yes. I left comments in the PR. Broadly, I think a couple of things need attention:

  1. need tests.
  2. failure behavior needs some more definition. how do we want to inform the user of what failed?
  3. what does a response look like for the create/grant that is both informative and unique?
  4. we discussed and don't want to include the with-roles method.
MGLL commented 9 months ago

From what I see, this issue can be closed as https://github.com/p2-inc/keycloak-orgs/pull/99 was merged.