SOAP Portal Dual-Role Tabs
Overview
Prior to v0.52.0, any user assigned a staff role
(Instructor, Advisor, School Director, Registrar,
Billing Staff, Admissions Officer, or System Manager)
was immediately redirected to /school-tools when visiting /soap,
even if they were also an enrolled student.
The dual-role tab feature allows these users to access their student portal and switch to the staff hub via role-switching tabs in the sidebar.
Who Sees the Tabs
A user must satisfy both conditions:
- Hold at least one staff role (listed above).
- Have an active Student record linked via
student.userorstudent.student_email_id.
System Managers using admin impersonation (?as_user=...) are not affected —
they always see the student context for the impersonated user.
How It Works
When a dual-role user visits /soap, the sidebar shows two pill tabs
immediately above the main navigation:
- Student (highlighted) — current view; standard student portal nav
- Staff — links to
/school-tools(Frappe Desk staff hub)
Technical Reference
soap.get_soap_context()— checksfrappe.db.exists("Student", {"user": u, "enabled": 1})before redirecting staff users; dual-role users fall through toget_soap_student()Layout.jsx— client-side guard changed fromis_stafftois_staff && !studentSidebar.jsx—sp-role-tabscomponent rendered whenisStaff && !isAdmin && student && staffPortals.length > 0styles.css—.sp-role-tabs,.sp-role-tab,.sp-role-tab-active- Shipped in v0.52.0, commit
748db76
Was this article helpful?