fix(dashboard): badge admins as Admin instead of No Membership (BUNYIP-108) #148

Merged
vas2000-work merged 2 commits from fix/BUNYIP-108-membership-badge-admin into main 2026-06-16 01:01:23 +02:00
Owner

What

Fix the dashboard membership card showing a "No Membership" badge to admins who actually have full access. has_active_membership (util.rs) grants access for role == Admin, but membership_badge had no admin case, so an admin whose membership_status was None (or Canceled/Past Due/Incomplete) rendered a "No Membership" pill next to "You have access to all applications" - a direct contradiction.

Change

  • membership_badge now returns an "Admin" badge for admins (early branch), reflecting the same all-access override that has_active_membership honors. Non-admin states (Lifetime, Trial, Active, Grace Period, Past Due, Canceled, Incomplete, None) are unchanged.

Testing (rust-builder container)

  • cargo test -p bunyip-web membership: admin -> "Admin" (not "No Membership"); non-admin/None -> "No Membership" (regression guard). Pass.
  • cargo clippy -p bunyip-web --all-targets -- -D warnings: clean.
  • cargo fmt --all --check: clean.
## What Fix the dashboard membership card showing a "No Membership" badge to admins who actually have full access. `has_active_membership` (util.rs) grants access for `role == Admin`, but `membership_badge` had no admin case, so an admin whose `membership_status` was `None` (or Canceled/Past Due/Incomplete) rendered a "No Membership" pill next to "You have access to all applications" - a direct contradiction. ## Change - `membership_badge` now returns an "Admin" badge for admins (early branch), reflecting the same all-access override that `has_active_membership` honors. Non-admin states (Lifetime, Trial, Active, Grace Period, Past Due, Canceled, Incomplete, None) are unchanged. ## Testing (rust-builder container) - `cargo test -p bunyip-web membership`: admin -> "Admin" (not "No Membership"); non-admin/None -> "No Membership" (regression guard). Pass. - `cargo clippy -p bunyip-web --all-targets -- -D warnings`: clean. - `cargo fmt --all --check`: clean.
fix(dashboard): badge admins as "Admin" instead of "No Membership" (BUNYIP-108)
Some checks failed
Check / fmt / clippy / build / test (pull_request) Has been cancelled
26f5c216a6
membership_badge fell through to a membership-status pill that read "No Membership" (or "Canceled" / "Past Due") for an admin whose Stripe status was not active, while has_active_membership grants admins full access. The dashboard therefore showed a "No Membership" badge next to "You have access to all applications" - a direct contradiction. Add an early admin branch so the badge reflects the all-access override, consistent with has_active_membership; non-admin states are unchanged. Adds unit tests for the admin and non-admin paths.

#BUNYIP-108

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge branch 'main' into fix/BUNYIP-108-membership-badge-admin
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt / clippy / build / test (pull_request) Successful in 1m1s
4e43b22ab1
vas2000-work deleted branch fix/BUNYIP-108-membership-badge-admin 2026-06-16 01:01:23 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!148
No description provided.