Skip to content
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

Cannot set ACL from JSON #2096

Closed
4 tasks done
dplewis opened this issue Mar 21, 2024 · 1 comment · Fixed by #2097
Closed
4 tasks done

Cannot set ACL from JSON #2096

dplewis opened this issue Mar 21, 2024 · 1 comment · Fixed by #2097

Comments

@dplewis
Copy link
Member

dplewis commented Mar 21, 2024

New Issue Checklist

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

Copy link

parse-github-assistant bot commented Mar 21, 2024

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant