Faculytics Docs

Auth & Hydration

Login strategy resolution, Moodle authentication flow, and institutional authority mapping.

When a user logs in, the AuthService resolves the appropriate login strategy based on priority ordering. Strategies are evaluated in order — the first one whose CanHandle() returns true is executed.

Login Strategy Resolution

Moodle Login Flow (Detail)

When the MoodleLoginStrategy handles the request, it performs full user hydration:

Institutional Authority Resolution (Dean Mapping)

The system automatically detects if a user has management authorities over specific categories (Campuses, Departments, or Programs).

  1. Capability Check: For each unique category a user is enrolled in, the system picks a representative course.
  2. Moodle Verification: It queries Moodle to see if the current user has the moodle/category:manage capability in that context.
  3. Role Persistence: If found, a UserInstitutionalRole (e.g., 'dean') is recorded for that specific category.
  4. Global Role Propagation: The user's global roles array is updated to include 'dean' if any institutional authority is detected.