roleLabel()
roleLabel()
roleLabel(
role,options?):string
Defined in: constants/roles.ts:113
Resolve a role’s presentation label from its code or its dynamic record. Resolution order:
options.overrides[code]if present- The record’s own
.name(dynamic roles loaded from the DB) KNOWN_BASE_ROLE_LABELS[code](seeded base roles)- Title-case fallback from the code itself
(
org_billing→Org Billing)
Example: roleLabel(‘system_admin’) // ‘System Admin’ roleLabel({ code: ‘system_admin’ }) // ‘System Admin’ roleLabel({ code: ‘custom-buyer-tier’, name: ‘Buyer (Gold)’ }) // ‘Buyer (Gold)’ — dynamic role wins roleLabel(‘unknown_code’) // ‘Unknown Code’
Parameters
role
string | RoleLike
options?
Returns
string