---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/users](../index.md) / grantRole

# Function: grantRole()

> **grantRole**(`client`, `options`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/users/index.ts:184](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d9cf11cf4a11828e783aed6313f5ea49990488ff/packages/b2c-tooling-sdk/src/operations/users/index.ts#L184)

Grants a role to a user, optionally with scope.
This updates the user's roles and roleTenantFilter.

## Parameters

### client

[`AccountManagerUsersClient`](../../../clients/type-aliases/AccountManagerUsersClient.md)

Account Manager client

### options

[`GrantRoleOptions`](../interfaces/GrantRoleOptions.md)

Grant options (userId, role, optional scope)

## Returns

`Promise`\<\{ \}\>

Updated user
