-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(rest): Prevent default ACL from overwriting custom ACL on update #10003
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
base: alpha
Are you sure you want to change the base?
fix(rest): Prevent default ACL from overwriting custom ACL on update #10003
Conversation
|
🚀 Thanks for opening this pull request! |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughDefault ACL assignment in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (7)📓 Common learnings📚 Learning: 2025-12-02T06:55:53.808ZApplied to files:
📚 Learning: 2025-05-04T20:41:05.147ZApplied to files:
📚 Learning: 2025-05-09T09:59:06.289ZApplied to files:
📚 Learning: 2025-05-09T09:59:06.289ZApplied to files:
📚 Learning: 2025-04-30T19:31:35.344ZApplied to files:
📚 Learning: 2025-10-16T19:27:05.311ZApplied to files:
🧬 Code graph analysis (1)spec/ParseACL.spec.js (3)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/RestWrite.js (1)
373-390: Add test for default ACL behavior on UPDATE operations.The existing test "support defaultACL in schema" verifies that default ACL is applied during CREATE. However, there's no test verifying that updates to objects with default ACLs do not reapply or overwrite the existing ACL. Add a test that:
- Creates an object with a class-level default ACL
- Updates the object
- Verifies the ACL from creation is preserved and not replaced by the default ACL
Also cover the edge case where a user explicitly modifies the ACL during an update.
🧹 Nitpick comments (1)
src/RestWrite.js (1)
373-390: Suggestion: Refine PR title to include scope.Based on coding guidelines, consider updating the PR title to:
fix(rest): prevent default ACL from overwriting custom ACL on updateThis format makes it clearer in the changelog what specific behavior was fixed and why it matters to developers.
Based on learnings, Angular commit convention suggests including a scope (e.g.,
rest,acl) to identify the subsystem affected.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/RestWrite.js
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:24.824Z
Learning: For Parse Server PRs, always suggest an Angular-style PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion with every new commit to the PR.
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:48.786Z
Learning: For Parse Server PRs, always suggest an Angular commit convention PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion on every commit. The format should be: type(scope): description. Common types include feat, fix, perf, refactor, docs, test, chore. The scope should identify the subsystem (e.g., graphql, rest, push, security). The description should be action-oriented and clearly convey the change's impact to developers.
🔇 Additional comments (1)
src/RestWrite.js (1)
373-390: LGTM! Correct fix that prevents ACL overwrite on updates.The addition of
!this.query &&correctly restricts default ACL assignment to CREATE operations only, preventing custom ACLs from being overwritten during UPDATE operations. This change is consistent with how other default fields likecreatedAtandobjectIdare handled (lines 393-422).
|
I will reformat the title to use the proper commit message syntax. |
|
I will reformat the title to use the proper commit message syntax. |
|
I will reformat the title to use the proper commit message syntax. |
9414f35 to
5c830dc
Compare
Summary
Fixed an issue where the default ACL defined in Class Level Permissions was incorrectly applied during object updates, overwriting any existing custom ACL.
Problem
When
classLevelPermissions.ACLis configured for a class, the default ACL was being applied on every save operation (both create and update). This caused existing objects to lose their custom ACL settings when updated without an explicit ACL in the request.Solution
Added a
!this.querycondition check before applying the default ACL. This ensures the default ACL is only set during object creation (whenthis.queryis null), not during updates. This behavior is consistent with how other default fields likecreatedAtare handled in RestWrite.Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.