How to create a REST query to get all roles assigned to a user?
As this is many to many relation in the opposite direction the regular $relatedTo
operator seems to be not enough...
finally I found the solution which seems to be much easier than I was afraid of :) As I found similar questions on SO and github I hope it will help others.
the curl
query to get all the roles directly assigned to a user is:
curl -X GET \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
https://parseapi.back4app.com/roles \
--data-urlencode \
'where={"users":{"__type":"Pointer","className":"_User","objectId":"<objectId>"}}'
来源:https://stackoverflow.com/questions/49838020/rest-query-to-get-all-roles-for-particular-user-from-parse-server