When Organizations Feature is released we started to migrating some apis to enable us to use new feature
In one specific task, I used that API(/api/v2/roles/{id}/users) to get all Users by Role.
Today I need find all Members from Organization with specific role id/name.
Like that: /api/v2/organizations/{id}/members/{role id/name}
but that API don’t exists, someone can help us with that? or this is impossible today? Finding all members of organization and get permissions each of them is some inviable.
I would use it to list all members with specific Role. I do that today with Roles API (/api/v2/roles/{id}/users) that API I can list all users with RoleID=xxxxxx, but using Organizations I cant do the same thing.
The use-case is, Today I use RBAC feature of Auth0 to control permissions inside my application, I want start use Organizations because is perfect to us who has a B2B Application, today I need create one Role with tenant name, for example “company1:guest”, “company2:guest”, and etc…
Now with Organizations I can create only one Role “guest” and assign that of each member on each Organization that he joined, that feature is perfect to us (thanks Auth0 for that).
With that idea, I want show to administrators of each Organization what users has each Role that assigned on Organization, the administrator of Organization in one frontend choose Role “guest” in one select(combobox), and I want list all users with “guest” Role on Organization. Is a simple query
The point is, I can do that using the Roles API (/api/v2/roles/{id}/users), but with Organizations feature I can’t
Thanks for that, @elton.nunes.sysmap - makes perfect sense. I’m flagging this thread and will let you know at such a time as we implement this endpoint.
You can estimate to me which time will take ?, because this endpoint is important to my solution, but if you can’t, no problem, I will implement in my side something to resolve that.
Hello. I am in need of the same thing as well. Is this in the roadmap of the product ? Or do you have an alternative that doesn’t imply doing tens of request to get the role of every user?
We ran into the same need - to be able to list organization members that have a particular role assigned.
On top of that, a complimentary API would be useful - one that would return a list roles assigned within an organization. Something like /api/v2/organizations/{id}/roles/.
We found a bad workaround - to list organization members, query each member’s roles, and then merge the list. Obviously, this doesn’t scale well with a growing list of members because of the per-member roundtrips.
@adam.housman Any update on prioritization of the original ask and if you’d consider adding an API like the one I suggested?
We are in need of this endpoint as well. Since we’re allowing users to delete a role even if it’s assigned to a user/users. This is causing an error where the user is left without a role and can’t do anything inside of our app.
A response to this issue would be greatly appreciated.
PS: It’s worth mentioning that we had found a workaround for this but as @sbykov mentioned that doesn’t scale well, and in our case, it resulted in a 429: Too Many Requests error.
Any update on this API feature? We are also in the same boat. Our workaround has been to list all organization members then query each members for their roles but with growing user base this will not scale as the number of API calls to get all member roles will grow exponentially with each new user.
I think we can pass the fields that we need when making the API call. So we can include “roles” and then it will return all members along with their roles.
Here is a sample code using auth0 sdk
I can confirm this worked for my use case. I couldn’t find any documentation that ‘roles’ is a valid field to pass in here based on what I read, but this did work.