K
Kinde3mo ago
lqh

How to append a role to an user given the userid using @kinde/management-api-js ?

I'm implementing a feature where an user with a specific role can append roles to other user in nextjs, I've read the docs https://kinde.com/api/docs/#update-property-value but still struggle. Thanks in advance!
5 Replies
IkiTg07
IkiTg073mo ago
Hey. The link you provided is for user properties and not roles strictly speaking. Could you please elaborate further about how your use case works ? I don't think you can programmatically add a role to a user but i'm looking for you
Mata1
Mata13mo ago
Hey, thanks for reply. We are on the same team. I will speak on his behalf. We wanna allow user to create an org and let them be the admin of their org. As an admin, they will have the ability to add members and grant members the roles/permissions to view certain things in their org. The entities I mentioned; org, roles, and permissions; belongs to our application, but it will be a 1-1 mapping to kinde entities. So an org in our application will map to an org in kinde. Also our application have a list of predefined roles that admin can grant to their members. These roles in our application will also have a corresponding role on kinde.
IkiTg07
IkiTg073mo ago
Alright i better understand but i've been looking for a way to append a rolw programmatically but couldn't find one. Maybe if you were to create an org that has a specified kinde role in it and add to user to this corresponding org
Mata1
Mata13mo ago
Is there any endpoint that I can use to grant roles for a user in an org? Can I wrap this endpoint as a way for my user to grant roles to another user in a kinde org?
Want results from more Discord servers?
Add your server