fix: map HelixEngage Supervisor platform role to admin app role

Supervisor users were getting 'executive' role because only 'HelixEngage
Manager' was mapped to admin. This broke admin route access after the
RequireAdmin guard was added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 06:47:01 +05:30
parent d97d73dd1a
commit 01348123e6

View File

@@ -107,11 +107,9 @@ export class AuthController {
// Determine app role from platform roles
let appRole = 'executive'; // default
if (roleLabels.includes('HelixEngage Manager')) {
if (roleLabels.includes('HelixEngage Manager') || roleLabels.includes('HelixEngage Supervisor')) {
appRole = 'admin';
} else if (roleLabels.includes('HelixEngage User')) {
// Distinguish CC agent from executive by email convention or config
// For now, emails containing 'cc' map to cc-agent
const email = workspaceMember?.userEmail ?? body.email;
appRole = email.includes('cc') ? 'cc-agent' : 'executive';
}