This bundle provides a number of command line utilities to help manage HarmonyCMS users. Commands are available for the following tasks:
You can use the
user:create command to create a new user for your application. The command takes three arguments, the
password for the user you are creating.
For example if you wanted to create a user with username
testuser, with email
firstname.lastname@example.org and password
p@ssword, you would run the command as follows.
php bin/console user:create testuser email@example.com p@ssword
If any of the required arguments are not passed to the command, an interactive prompt will ask you to enter them. For example, if you ran the command as follows, then you would be prompted to enter the
password for the user you want to create.
php bin/console user:create testuser
--super-admin option will flag the user as a super admin when the user is created. A super admin has access to any part of your application. An example is provided below:
php bin/console user:create adminuser --super-admin
user:promote command enables you to add a role to a user or make the user a super administrator.
If you would like to add a role to a user you simply pass the
username of the user as the first argument to the command and the
role to add to the user as the second.
php bin/console user:promote testuser ROLE_ADMIN
You can promote a user to a super administrator by passing the
--super option after specifying the
php bin/console user:promote testuser --super