mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
Make a hierarchy in roles
This is more understandable for users.
This commit is contained in:
@@ -56,12 +56,20 @@ class ComposedRoleScopeType extends AbstractType
|
||||
*/
|
||||
private $translatableStringHelper;
|
||||
|
||||
public function __construct(TranslatableStringHelper $translatableStringHelper,
|
||||
RoleProvider $roleProvider)
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var RoleProvider
|
||||
*/
|
||||
private $roleProvider;
|
||||
|
||||
public function __construct(
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
RoleProvider $roleProvider
|
||||
) {
|
||||
$this->roles = $roleProvider->getRoles();
|
||||
$this->rolesWithoutScope = $roleProvider->getRolesWithoutScopes();
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->roleProvider = $roleProvider;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
@@ -86,6 +94,9 @@ class ComposedRoleScopeType extends AbstractType
|
||||
} else {
|
||||
return array('data-has-scope' => '1');
|
||||
}
|
||||
},
|
||||
'group_by' => function($role, $key, $index) {
|
||||
return $this->roleProvider->getRoleTitle($role);
|
||||
}
|
||||
))
|
||||
->add('scope', 'entity', array(
|
||||
|
Reference in New Issue
Block a user