Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse JS SDK.
Issue Description
Saving ACL from JSON throws ACL must be a Parse.ACL
error. The validation on ACL prevents the json from properly encoding. This may also fix the issue #2028
Steps to reproduce
it('can set ACL from json', async () => {
Parse.User.enableUnsafeCurrentUser();
const user = new Parse.User();
const object = new TestObject();
user.set('username', 'torn');
user.set('password', 'acl');
await user.signUp();
const acl = new Parse.ACL(user);
object.setACL(acl);
const json = object.toJSON();
await object.save(json); // This breaks ACL must be a Parse.ACL.
assert.equal(acl.equals(object.getACL()), true);
});
This error also happens when on object.set({ ACL: acl.toJSON() })
;
Actual Outcome
Throws error
Expected Outcome
Should save object properly
Environment
Server
- Parse Server version:
6.0.0
- Operating system:
MacOS
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.4
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- Parse JS SDK version:
4.3.1
Logs
Metadata
Metadata
Assignees
Labels
No labels