Fix authorization errors reversing current and allowed roles - #969
HarshMN2345 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAuthorization denial descriptions now list denied and allowed roles as arrays. Unit and end-to-end tests verify the updated messages for authorization and document relationship operations. ChangesAuthorization denial messages
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The authorization diagnostics match the intended role ordering and array format, with no remaining merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
Denied authorization messages identified the last allowed role as the caller, then reversed the current and allowed role lists. Report the caller’s complete role list and the resource’s allowed roles in the correct positions. Permission checks themselves are unchanged.
The regression covers multiple allowed roles, a guest caller, and a caller with no roles. It fails against the original implementation and passes with the fix. Focused authorization tests pass (three tests, 30 assertions), as do Pint and targeted PHPStan level 7. On commit b56a4da, GitHub CI passed the full unit suite (470 tests, 2,412 assertions), all 16 adapter lanes, Linter, and CodeQL. Shared adapter assertions also verify the corrected diagnostics for document updates and relationship permissions.
Addresses appwrite/appwrite#7201.
Appwrite must adopt a released package version to receive this change.
Summary by CodeRabbit