API version: 0.3.0

---

# `user:role:remove`

Removes a role from a user. All assignments of the role are removed, independent of their issuer. This is also the way to clean up roles which are no longer defined in the instance configuration.

The command fails if the user does not hold the role.

See [roles and capabilities](/reference/roles-and-capabilities.md) for the concept.

## Help

```bash
php bin/console user:role:remove --help
```

```text
Description:
  Removes a role from a user.

Usage:
  user:role:remove <user> <role>

Arguments:
  user                  Unique identifier of the user or the user's UUID
  role                  Name of the role; all assignments of the role are removed

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

## Example

```bash
php bin/console user:role:remove user-role-command-test@localhost.dev admin
```

```text
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.3.0, production mode

  User Role Remove

▶ Removed 1 assignment(s) of role 'admin' from user 02IiNr0GPQPedaZ1eAaSPm11iq2BJRlhcDDE5.
```

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [user:role:list](/command/user-role-list.md)
