'Parse CloudCode: How to check if curent user belongs to a role hierarchy?

In CloudCode, is there any utility function which I can determine that the current user belongs to a certain role?

Assume the following role hierarchy Admin->Manager->User

If I added user1 to the Admin role, this means if in cloud code if I query all the roles this user belongs to, then I will get immediate list of roles not hierarchy. I am wondering if there is a utility function that helps with this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source