REST query to get all roles for particular user from parse server

限于喜欢 提交于 2019-12-08 02:07:53

问题


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...


回答1:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!