Closed
Description
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:
{
"_id": "KJXlhIPK4R",
"_rperm": [
"KJXlhIPK4R",
"role:Admin"
],
"_wperm": [
"KJXlhIPK4R"
],
...
}
Steps to reproduce
Have the user call a cloud code method that looks like this:
Parse.Cloud.define('someMethod', function(request, response) {
request.user.fetch().then(function() {
// success
},
function() {
response.error('Error getting user data.');
});
});
Logs/Trace
GET /parse/classes/_User/KJXlhIPK4R { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.1 (NodeJS 5.0.0)',
accept: '*/*',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '154',
connection: 'close' } {}
error: ParseError { code: 101, message: 'Object not found.' }
error: ParseError { code: 141, message: 'Error getting user data.' }
Metadata
Metadata
Assignees
Labels
No labels