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 for the concept.
Help
php bin/console user:role:remove --helpDescription: 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
php bin/console user:role:remove user-role-command-test@localhost.dev admin▄ ▄▀ ▀▄ Ember Nexus API ▀█▀ v0.3.0, production mode User Role Remove ▶ Removed 1 assignment(s) of role 'admin' from user 02IiNr0GPQPedaZ1eAaSPm11iq2BJRlhcDDE5.