Skip to content

Fix authorization errors reversing current and allowed roles - #969

Draft
HarshMN2345 wants to merge 1 commit into
mainfrom
codex/fix-authorization-error-roles
Draft

Fix authorization errors reversing current and allowed roles#969
HarshMN2345 wants to merge 1 commit into
mainfrom
codex/fix-authorization-error-roles

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

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.

Fixes appwrite/appwrite#7201.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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 this pull request may close these issues.

🐛 Bug Report: Incorrect auth error

1 participant