mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 14:09:29 +08:00
Align the five remaining two-value gate idioms with the "only 'admin' elevates" invariant that #1556 now documents: self-service learner-profile access (_require_local_learner), the admin-managed learner-profile GET/PUT target checks, the identity-layer set_learner_profile writer, and device-credential activation (_active_account) admit every non-admin role instead of only "user". While the admitted vocabulary is still {"admin", "user"} this is behavior-preserving; once "teacher"/"student" exist, ordinary accounts keep learner profiles and device logins instead of being silently excluded. Admins stay excluded everywhere, including admins carrying a learner preset. Tests: a teacher with a learner preset manages their own profile through the self-service endpoints and via an admin actor; admins (even with a learner preset) stay rejected at the self-service, admin-managed, storage, and device-credential layers; a device credential issued for a teacher logs in and reports the teacher role, while issuance for an admin still fails closed.