Skip to content

fix(permissions): keep staff:access out of full_session and the wildcard - #367

Merged
BryanFRD merged 1 commit into
mainfrom
fix/347-staff-access-wildcard
Oct 25, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
fix/347-staff-access-wildcard

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

full_session() and the * wildcard no longer grant StaffAccess; callers add it explicitly after the is_staff check. An explicit staff:access string alongside * is still honored. OrgOwner is left in full_session() (issue marks it optional).

Closes #347

@ferrfleet-interne ferrfleet-interne Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is correct. Merging the wildcard into the parsed set, instead of replacing it, keeps an explicit staff:access, and no other scope implies StaffAccess, so has() can't grant it by another route.

  • Nit: two doc comments are now stale. Line 26 of the module doc still says sessions "get every scope implicitly". The doc on from_strings_with_wildcard (~line 382) still calls "*" the "historical behaviour for staff-issued super-tokens", but "*" no longer grants staff access.
  • Nit: this changes behaviour for consumers. Any existing API token stored as ["*"] loses /admin/* access. Any service that relied on full_session() for staff users now has to insert(Scope::StaffAccess) after its is_staff check. That is worth a line in the changelog or release notes so downstream crates catch it when they bump.

@BryanFRD
BryanFRD merged commit 5907ec3 into main Oct 25, 2026
19 checks passed
@BryanFRD
BryanFRD deleted the fix/347-staff-access-wildcard branch October 25, 2026 10:18
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.

fix(permissions): keep staff:access out of full_session and the wildcard

1 participant