The user role form type class provide a new form type class who list all available roles from security.role_hierarchy.roles.
This new form type class can be used like:
use Harmony\Bundle\UserBundle\Form\Type\UserRoleType;
$builder->add('roles', UserRoleType::class);Example to add a property roles with the custom type to get list of all roles:
- { property: 'roles', type: Harmony\Bundle\UserBundle\Form\Type\UserRoleType }