mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[main] allow hide change user password menu
This commit is contained in:
parent
8eef073988
commit
f77031630f
@ -11,6 +11,7 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
|
* [main] allow hide change user password menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||||
* [main] filter user jobs by active jobs (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
* [main] filter user jobs by active jobs (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||||
* [main] add civility to User (entity, migration and form type) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
* [main] add civility to User (entity, migration and form type) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||||
|
|
||||||
|
@ -129,6 +129,11 @@ class ChillMainExtension extends Extension implements
|
|||||||
$config['access_global_history']
|
$config['access_global_history']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$container->setParameter(
|
||||||
|
'chill_main.access_user_change_password',
|
||||||
|
$config['access_user_change_password']
|
||||||
|
);
|
||||||
|
|
||||||
$container->setParameter(
|
$container->setParameter(
|
||||||
'chill_main.routing.resources',
|
'chill_main.routing.resources',
|
||||||
$config['routing']['resources']
|
$config['routing']['resources']
|
||||||
|
@ -116,6 +116,9 @@ class Configuration implements ConfigurationInterface
|
|||||||
->booleanNode('access_global_history')
|
->booleanNode('access_global_history')
|
||||||
->defaultTrue()
|
->defaultTrue()
|
||||||
->end()
|
->end()
|
||||||
|
->booleanNode('access_user_change_password')
|
||||||
|
->defaultTrue()
|
||||||
|
->end()
|
||||||
->arrayNode('redis')
|
->arrayNode('redis')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('host')
|
->scalarNode('host')
|
||||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
use Chill\MainBundle\Notification\Counter\NotificationByUserCounter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
use Chill\MainBundle\Workflow\Counter\WorkflowByUserCounter;
|
||||||
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
@ -28,16 +29,20 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
private WorkflowByUserCounter $workflowByUserCounter;
|
private WorkflowByUserCounter $workflowByUserCounter;
|
||||||
|
|
||||||
|
protected ParameterBagInterface $parameterBag;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
NotificationByUserCounter $notificationByUserCounter,
|
NotificationByUserCounter $notificationByUserCounter,
|
||||||
WorkflowByUserCounter $workflowByUserCounter,
|
WorkflowByUserCounter $workflowByUserCounter,
|
||||||
Security $security,
|
Security $security,
|
||||||
TranslatorInterface $translator
|
TranslatorInterface $translator,
|
||||||
|
ParameterBagInterface $parameterBag
|
||||||
) {
|
) {
|
||||||
$this->notificationByUserCounter = $notificationByUserCounter;
|
$this->notificationByUserCounter = $notificationByUserCounter;
|
||||||
$this->workflowByUserCounter = $workflowByUserCounter;
|
$this->workflowByUserCounter = $workflowByUserCounter;
|
||||||
$this->security = $security;
|
$this->security = $security;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
|
$this->parameterBag = $parameterBag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||||
@ -85,14 +90,16 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'order' => 700,
|
'order' => 700,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menu
|
if ($this->parameterBag->get('chill_main.access_user_change_password')) {
|
||||||
->addChild(
|
$menu
|
||||||
'Change password',
|
->addChild(
|
||||||
['route' => 'change_my_password']
|
'Change password',
|
||||||
)
|
['route' => 'change_my_password']
|
||||||
->setExtras([
|
)
|
||||||
'order' => 99999999998,
|
->setExtras([
|
||||||
]);
|
'order' => 99999999998,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu
|
$menu
|
||||||
|
Loading…
x
Reference in New Issue
Block a user