Add Instructors admin page (create + per-capability access) #30
Reference in New Issue
Block a user
Delete Branch "feature/instructor-management"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completes the second half of #9 — instructor management. The capability slice (the
us_studio_adminrole and the cap matrix) shipped in #10; this adds the Instructors admin page the issue specifies.What changed
InstructorController(gated onmanage_instructors): lists instructors, creates aus_instructorWordPress user (emailing them a set-password link viawp_new_user_notification), and a per-instructor capability detail view.InstructorCapabilities— the pure, unit-tested rules: which managed capabilities the acting admin may assign, and how a submitted form maps to per-user grants/denials. Kept free of WordPress so it's testable (mirrors howStudentControllerpairs withStudentSchedule).manage_instructors.instructors.php(list + create form) andinstructor-detail.php(capability toggles).Capability model
The managed (toggleable) capabilities are
manage_offerings,manage_questions,view_own_payments, andexport_payments.manage_availabilityandview_own_lessonsare core to every instructor and aren't managed here. Theus_instructorrole grants the managed caps by default; the page layers per-user overrides on top (no change toRoleManager, matching the capability matrix).A studio admin can never grant a capability it does not itself hold:
current_user_can(), so an administrator's dynamic studio grant counts;Checks
composer test(189 tests, 541 assertions),composer lint(PHPStan L6 — no errors),composer cs(PHPCS) all green. NewInstructorCapabilitiesTest;docs/features/user-roles.mdupdated.Closes #9.
🤖 Generated with Claude Code