Grant studio-admin caps to administrators; re-gate Scheduler; mark 1.0.0-rc.1 #13

Merged
thatguygriff merged 2 commits from feature/admin-studio-caps into main 2026-06-05 15:13:29 +00:00
Owner

Makes the studio owner's WordPress administrator account run the studio, and marks the plugin as a release candidate.

Administrators get studio-admin capabilities

  • New user_has_cap filter (RoleManager::grantStudioCapsToAdministrators()) grants every studio-admin capability to any user with manage_options.
  • Dynamic — persists nothing, and the grant disappears when the plugin is deactivated.
  • One-way: the us_studio_admin role still grants only studio caps and confers no core WordPress admin powers (no plugin install, user/content/settings management). It remains available for non-administrator studio staff.
  • Studio-admin caps consolidated into a single STUDIO_ADMIN_CAPS source of truth.

Re-gate the Scheduler dashboard

  • Added a dedicated view_all_lessons capability (parallel to view_all_payments) to the studio-admin set.
  • The studio-wide Scheduler page is now gated on view_all_lessons in both AdminMenu and LessonController::renderAdminDashboard, instead of manage_options — so a us_studio_admin user can see it too (administrators still do, via the cap filter).

Version

  • Bumped to 1.0.0-rc.1 to reflect the in-progress, pre-release state (header + USC_VERSION). Verified composer build emits unsupervised-schedular-1.0.0-rc.1.zip and the packaged header matches. Will move to 1.0.0 before tagging a release.

Docs & tests

  • docs/features/user-roles.md (cap matrix + administrator note), docs/features/lesson-booking.md (Scheduler gating)
  • Tests: administrators receive all studio caps; non-admins receive none

Verification: 65 tests / 200 assertions pass; PHPCS clean; PHPStan level 6 no errors. Branch rebased on current main (includes #12).

🤖 Generated with Claude Code

Makes the studio owner's WordPress administrator account run the studio, and marks the plugin as a release candidate. ## Administrators get studio-admin capabilities - New `user_has_cap` filter (`RoleManager::grantStudioCapsToAdministrators()`) grants every studio-admin capability to any user with `manage_options`. - Dynamic — persists nothing, and the grant disappears when the plugin is deactivated. - One-way: the `us_studio_admin` role still grants **only** studio caps and confers **no** core WordPress admin powers (no plugin install, user/content/settings management). It remains available for non-administrator studio staff. - Studio-admin caps consolidated into a single `STUDIO_ADMIN_CAPS` source of truth. ## Re-gate the Scheduler dashboard - Added a dedicated **`view_all_lessons`** capability (parallel to `view_all_payments`) to the studio-admin set. - The studio-wide **Scheduler** page is now gated on `view_all_lessons` in both `AdminMenu` and `LessonController::renderAdminDashboard`, instead of `manage_options` — so a `us_studio_admin` user can see it too (administrators still do, via the cap filter). ## Version - Bumped to **`1.0.0-rc.1`** to reflect the in-progress, pre-release state (header + `USC_VERSION`). Verified `composer build` emits `unsupervised-schedular-1.0.0-rc.1.zip` and the packaged header matches. Will move to `1.0.0` before tagging a release. ## Docs & tests - `docs/features/user-roles.md` (cap matrix + administrator note), `docs/features/lesson-booking.md` (Scheduler gating) - Tests: administrators receive all studio caps; non-admins receive none Verification: 65 tests / 200 assertions pass; PHPCS clean; PHPStan level 6 no errors. Branch rebased on current `main` (includes #12). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 2 commits 2026-06-05 15:08:38 +00:00
WordPress administrators (manage_options) now implicitly hold every
studio-admin capability via a user_has_cap filter, so the site owner runs
the studio without being assigned the separate us_studio_admin role. The
grant persists nothing and is removed on deactivation. The us_studio_admin
role still exists for non-administrator staff and does NOT confer any core
WordPress admin powers.

Also re-gate the studio-wide "Scheduler" dashboard off manage_options onto
a new view_all_lessons capability (added to the studio-admin cap set), so a
us_studio_admin user can see it too — previously it was administrator-only.

- RoleManager: STUDIO_ADMIN_CAPS constant, CAP_VIEW_ALL_LESSONS,
  grantStudioCapsToAdministrators() user_has_cap filter
- AdminMenu + LessonController: Scheduler gated on view_all_lessons
- Docs: user-roles.md cap matrix + administrator note; lesson-booking.md
- Tests: administrators receive studio caps; non-admins do not

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark version as 1.0.0-rc.1
CI / Coding Standards (pull_request) Successful in 55s
CI / PHPStan (pull_request) Successful in 1m4s
CI / Tests (PHP 8.1) (pull_request) Successful in 50s
CI / Tests (PHP 8.2) (pull_request) Successful in 45s
CI / Tests (PHP 8.3) (pull_request) Successful in 48s
CI / No Debug Code (pull_request) Successful in 2s
CI / Build Plugin Zip (pull_request) Has been skipped
cbf05fe363
Reflect the in-progress, pre-release state. Bump to 1.0.0 before tagging a
release. Updates both the plugin header and USC_VERSION; the build/CI zip
artifact name tracks this automatically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
thatguygriff merged commit 3afa8d80f2 into main 2026-06-05 15:13:29 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#13