-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Need master key perms to call request.user.fetch() in cloud code #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The difference in the node environment is that there is no 'current' user. So, in order to make a query as a user, you need to pass in the users session token, or override security with the master key option. This may seem slightly counter-intuitive at first, but it is correct.
|
For sending push notification I am using Parse.push.send() , which requires a querry for fetching the Installations to which the notification will be sent, but there is no way to set the useMasterKey: true there, what can I do to overcome that ? |
You need to pass |
It am passing userMasterKey: true, but still getting Error: unauthorized: master key is required, here is my code:
|
This code works on legacy Parse without using the master key. On Parse Server I need to send {useMasterKey: true} to the fetch() call to make it work. Shouldn't cloud code assume the permissions of the user making the call?
Environment Setup
A user that looks like this is logged in to our iOS app:
Steps to reproduce
Have the user call a cloud code method that looks like this:
Logs/Trace
The text was updated successfully, but these errors were encountered: