Skip to content

fix: include super admin in hasAnyPermission semantics#5566

Merged
nobodyiam merged 4 commits into
apolloconfig:2.xfrom
nobodyiam:codex/2.x-super-admin-permission-fix
Feb 21, 2026
Merged

fix: include super admin in hasAnyPermission semantics#5566
nobodyiam merged 4 commits into
apolloconfig:2.xfrom
nobodyiam:codex/2.x-super-admin-permission-fix

Conversation

@nobodyiam
Copy link
Copy Markdown
Member

@nobodyiam nobodyiam commented Feb 21, 2026

What's the purpose of this PR

This PR fixes a super-admin permission regression in Portal.

After permission checks were unified to hasAnyPermission(...), super admins could still see namespace edit/publish actions in UI, but backend operations returned 403 when explicit namespace permissions were not granted.

This change restores expected semantics by including super-admin bypass in unified permission checks, adds a Portal UI E2E regression test, and prepares the 2.x branch for follow-up patch releases.

Which issue(s) this PR fixes:

Fixes #5567

Brief changelog

  • Fix: include super-admin semantics in DefaultRolePermissionService.hasAnyPermission(...).
  • Tests: add/update portal permission tests:
    • apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/component/UserPermissionValidatorTest.java
    • apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/spi/defaultImpl/RolePermissionServiceTest.java
  • E2E: add regression case in e2e/portal-e2e/tests/portal-priority.spec.js
    • super admin can edit and release namespace without explicit namespace roles @regression
  • Branch maintenance (2.x):
    • archive 2.5.0 release notes to changes/changes-2.5.0.md
    • set root revision to 2.5.1-SNAPSHOT
    • reset CHANGES.md top section to 2.5.1

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Run mvn spotless:apply to format your code.
  • Update the CHANGES log.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 21, 2026
@dosubot
Copy link
Copy Markdown

dosubot Bot commented Feb 21, 2026

Related Documentation

Checked 0 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Feb 21, 2026
@nobodyiam nobodyiam force-pushed the codex/2.x-super-admin-permission-fix branch from 9d6eb70 to 3f48d5d Compare February 21, 2026 11:27
@nobodyiam nobodyiam changed the title fix: restore super admin bypass for unified permission checks fix: include super admin in hasAnyPermission semantics Feb 21, 2026
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 21, 2026
@nobodyiam nobodyiam added this to the 2.5.1 milestone Feb 21, 2026
@nobodyiam nobodyiam merged commit ae1b666 into apolloconfig:2.x Feb 21, 2026
3 checks passed
@nobodyiam nobodyiam deleted the codex/2.x-super-admin-permission-fix branch February 21, 2026 13:19
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant