mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix: fix usage of scope picker with unactives scopes
This commit is contained in:
parent
cb1ea8c622
commit
a1421ea99f
@ -60,7 +60,8 @@ class ScopePickerType extends AbstractType
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$items = array_filter(
|
$items = array_values(
|
||||||
|
array_filter(
|
||||||
$this->authorizationHelper->getReachableScopes(
|
$this->authorizationHelper->getReachableScopes(
|
||||||
$this->security->getUser(),
|
$this->security->getUser(),
|
||||||
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
|
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
|
||||||
@ -69,7 +70,7 @@ class ScopePickerType extends AbstractType
|
|||||||
static function (Scope $s) {
|
static function (Scope $s) {
|
||||||
return $s->isActive();
|
return $s->isActive();
|
||||||
}
|
}
|
||||||
);
|
));
|
||||||
|
|
||||||
if (0 === count($items)) {
|
if (0 === count($items)) {
|
||||||
throw new RuntimeException('no scopes are reachable. This form should not be shown to user');
|
throw new RuntimeException('no scopes are reachable. This form should not be shown to user');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user