Get roles of user (including child roles)

Hey!

Is there an “easy” way to get all roles of an user.

Let’s say I have an Admin role and a moderator role.
So I am adding the Admin role to the moderator role.

What I need is to get all roles which I am in. Even the child roles.

When Admin it should return Admin, Moderator. I need this in client to disable some menu entries. Logic to write and read is managed by ACL etc.

When I query in a cloud function for role.getUsers() and add constrain with the user it doesn’t return the child roles.

Thanks!

Thanks!

I don’t think there is an easy way to do that. You will probably have to create a cloud code function to get the data that you need.