Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / clients / resolveToInternalRole

Function: resolveToInternalRole()

resolveToInternalRole(role, mapping): string

Defined in: packages/b2c-tooling-sdk/src/clients/am-api.ts:148

Resolves a role to its internal roleEnumName using an API-fetched role mapping. Accepts either the role id (e.g., bm-admin) or roleEnumName (e.g., ECOM_ADMIN). Falls back to a generic transform (uppercase + replace hyphens with underscores) for unknown roles.

Parameters

role

string

mapping

RoleMapping

Returns

string

Released under the Apache-2.0 License.