Hello guys !
I have a problem with a feature that i want to do : create a cloud function that return a boolean true/false if the current User is Admin or not.
- Gets all Roles in the database (WORK Fine) (But can’t access to Users relation from Roles)
- Can’t get the current user and his role list to check if he has the admin role…
I can’t find any information in the documentation, how i can retrieve the user and his roles ?
I can see this object ID in cloud function logs, but can’t retrieve it.
I tried : Use Moralis SDK Moralis.User.current(); (return undefined), Roile.getUsers() (return undefined)
request.user (return undefined)
The user is correctly connected on my dapp before call cloud function : Moralis.User.current() return the current user on my dapp no problem.
Some one can help me plz ?