-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
sessionTokens / ACLs are not transmitted to queries triggered by CloudCoude #4801
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
Try this..
|
I'll try, but having to pass the request object (or the user object) to every sub-method call is not very convenient, and doesn't help clean code with small methods ;) I thought the default mode would be to keep using the sessionToken except if |
This will answer your question. |
The closest solution I could suggest to you is to create a Parse.Query extension (subclass) and initialize it with a user maybe like this This is the closest as you will get to Parse.com (as far as I know) |
thanks @georgesjamous I'll give it a try :) |
Closing as this is the expected behaviour. Unless we accomplish a major refactor to cloud code, this is here to stay. |
Issue Description
When a user calls a cloudcode function, he's identified as the
request.user
This user is used for all the ACLs. As an example it's taken into account for saving objects.
But if the cloudcode function performs a query, it seems it doesn't pass the sessionToken in the rest request, as the query doesn't use the right ACLs.
Steps to reproduce
I create a PFObject with a read/write ACL for the currentUser only
If I use the JS SDK to perform a query on that object, it works perfectly
If I use a cloud function which perform the exact same query, I have no result
Expected Results
The query triggered by the cloud function should be "identified" with the same user to respect the ACLs
Environment Setup
Server
Database
The text was updated successfully, but these errors were encountered: