Skip to content
rw3iss Auth

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:

  1. options.overrides[code] if present
  2. The record’s own .name (dynamic roles loaded from the DB)
  3. KNOWN_BASE_ROLE_LABELS[code] (seeded base roles)
  4. Title-case fallback from the code itself (org_billingOrg 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?

RoleLabelOptions

Returns

string