Beginner May 11, 2026 · 1 min read

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:

  1. Hold at least one staff role (listed above).
  2. Have an active Student record linked via student.user or student.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() — checks frappe.db.exists("Student", {"user": u, "enabled": 1}) before redirecting staff users; dual-role users fall through to get_soap_student()
  • Layout.jsx — client-side guard changed from is_staff to is_staff && !student
  • Sidebar.jsxsp-role-tabs component rendered when isStaff && !isAdmin && student && staffPortals.length > 0
  • styles.css.sp-role-tabs, .sp-role-tab, .sp-role-tab-active
  • Shipped in v0.52.0, commit 748db76
Was this article helpful?