Moodle Engineering · Role-Based Access Control
PENABUR School User Manager — Moodle Plugin
School mapping, manager authorization, and existing-user memberships
An alpha-stage Moodle local plugin (local_schoolusers v0.3.0) for administering school/category mappings, assigning school managers, and classifying existing students and teachers per school. Each Moodle installation remains independent; this plugin does not create accounts or synchronize servers.
01 · PROBLEM
The operational challenge
Schools sharing one Moodle installation need reliable boundaries for category mapping, manager access, and member counts without accidentally granting global account privileges or exposing other schools' identities.
02 · SOLUTION
How I approached it
I developed a Moodle-native PHP plugin with admin-only school and membership configuration, disjoint course-category mapping validation, explicit manager assignments and revocation, read-only scoped school dashboards, XMLDB schema upgrades, and Moodle Privacy API integrations. Access requires both an active manager assignment and the category-context view capability; administrator writes use session-key checks and independent authorization. Validation covered six official Moodle/PHP combinations in disposable environments, not production hosts.
03 · KEY FEATURES
What the system does
Register, edit, activate, or deactivate school records mapped to existing Moodle course-category subtrees
Reject overlapping category trees and recheck current category ancestry during authorization
Assign, revoke, or reactivate eligible existing user accounts as school managers
Require both explicit active school assignment and local/schoolusers:view in the mapped category context
Manage active/inactive existing student and teacher memberships as site admin; one membership type per school
Read-only manager view of authorized schools and separate student, teacher and total counts—without individual names
Three Moodle XMLDB tables and upgrade logic, bilingual English/Indonesian interface, Privacy API discovery/export/approved erasure
Documented disposable-runtime test matrix: six Moodle/PHP combinations, 564 passing test executions and 1,530 assertions
Alpha Phase 2B only: no account creation, Excel/CSV import, cohort management, audit log, shared cross-server database or production deployment
04 · TECHNOLOGY
Tools and platform
05 · OUTCOME