The T280307: Mentor dashboard: M2 mentor tools/settings part of the mentor dashboard will allow mentors to set themselves as away. This will result in questions asked by their mentees being sent to a backup mentor for the duration of their away-ness. This means we need to assign backup mentors to the users as well.
Thanks to mentor/mentee relationship now being stored in a DB table, which has column to indicate mentor's role, this should be just a matter of changing the mentor manager and relevant hooks to account for different kind of mentors.
Plan
- Require all callers of MentorStore::loadMentorUser() and MentorStore::setMentorForUser() to pass a valid mentor role. This will make the code more understandable. Currently, the default is to use ROLE_PRIMARY.
- Add backup mentor logic to the MentorManager
- Assign backup mentors to new users from MentorHooks
We do not need to care about existing users, as MentorManager will assign a backup mentor to them on-the-fly.