← Toutes les offres
F/

Fix /employee role verification vs SBO ownership; add business-scoped CEO context/dashboard

Fix /employee role verification vs SBO ownership; add business-scoped CEO context/dashboard

Global
Publié le 19 novembre 2026

Description du poste

## Observed production bug (2026-11-19) Authenticated business creator/SBO owner visits https://syncworksapp.com/employee and sees: "Unable to verify employee permissions. Access is unavailable until verification succeeds." Header identifies "Employee — Technician". Screenshot supplied in ChatGPT. ## Required diagnosis - Trace /employee routing and employee permission/role API. Distinguish unauthorized (403, user is not an employee) from unavailable (network, 5xx, parsing). - Check current user's business ownership/membership, business tenant selection, auth token, X-Business-Id scoping, and employee team member record. Never grant roles based solely on an email, frontend role state, or business creation inference. - Confirm /sbo dashboard is separately reachable when current user is an OWNER of the selected business. Do not gate SBO by employee permission verification. - On /employee, if authenticated but not an employee, show "No employee role for this business" with switch-to-business or customer dashboard, not generic verification failure. If API verification truly failed, show retry and diagnostic error code. - Preserve least privilege: OWNER authorization must be server-side, scoped to business; employee tools remain separately gated. Test 401/403/5xx distinct. ## Product: explicit independent role contexts One account can have multiple memberships: platform admin (platform-scoped), business owner/CEO (business-scoped), manager, dispatcher, technician, accounting, PM, customer, plus subcontractor. Do not make them mutually exclusive. Business ownership from creating a business should generate verified OWNER membership. Use backend-driven /me/access-contexts response listing permitted contexts with business id, business name, roles and permissions; frontend switches current context and routes accordingly. ## CEO dashboard Create independent /ceo/:businessId or selected-business /ceo view: executive summary for that specific business (revenue, jobs, team, lea