You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Step 2. Create a ParseObject by JS SDK or REST API
var Parse = require('parse/node');
Parse.initialize("myAppId");
Parse.serverURL = 'http://localhost:1337/parse'
var Test = Parse.Object.extend("Test");
var test = new Test();
test.set('score', 123);
var acl = new Parse.ACL();
acl.setPublicReadAccess(true);
test.setACL(acl);
test.save(null,{
success: function(test) {
console.log(test._toFullJSON());
console.log('success');
},
error: function(test, error) {
console.log('error');
}
});
This means we successfully save the ParseObject, we just do not expose the ACL info to afterSave hook.
If we go deeper we can find in RestWrite, before runDatabaseOperation, this.data contains the ACL info, but after runDatabaseOperation, this.data does not have the ACL info.
Update:
If we update the ParseObject with ACL, we can get the ACL info in the afterSave hook.
The text was updated successfully, but these errors were encountered:
Found the reason, working on a fix - when we do transform* for running RestWrite - we are deleting an ACL, since we are not copying the data that goes into the database, but rather doing transform/untransform on it, which erases ACL since it's required to be in a different format...
The fix is somewhat trivial, but would need to investigate a bit on what is the implication on this.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
-[ ] You've met the prerequisites.
-[ ] You're running the latest version of Parse Server.
-[ ] You've searched through existing issues. Chances are that your issue has been reported or resolved before.
Environment Setup
Run parse-server master branch locally
Steps to reproduce
Step 1. Set a afterSave hook for a ParseObject like
Step 2. Create a ParseObject by JS SDK or REST API
Logs/Trace
The log of the cloud code is
If we try to retrive the ParseObject by REST API, like
The return value is
This means we successfully save the ParseObject, we just do not expose the ACL info to afterSave hook.
If we go deeper we can find in
RestWrite
, beforerunDatabaseOperation
,this.data
contains the ACL info, but afterrunDatabaseOperation
,this.data
does not have the ACL info.Update:
If we update the ParseObject with ACL, we can get the ACL info in the afterSave hook.
The text was updated successfully, but these errors were encountered: