mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[main] allow hide permissions group list menu
This commit is contained in:
parent
cecfa1a18a
commit
a4210dd2c7
@ -11,6 +11,7 @@ and this project adheres to
|
||||
## Unreleased
|
||||
|
||||
<!-- write down unreleased development here -->
|
||||
* [main] allow hide permissions group list menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
* [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] add civility to User (entity, migration and form type) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
|
@ -38,6 +38,8 @@ class UserController extends CRUDController
|
||||
{
|
||||
public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
||||
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
private UserPasswordEncoderInterface $passwordEncoder;
|
||||
@ -46,8 +48,6 @@ class UserController extends CRUDController
|
||||
|
||||
private ValidatorInterface $validator;
|
||||
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
public function __construct(
|
||||
LoggerInterface $chillLogger,
|
||||
ValidatorInterface $validator,
|
||||
|
@ -134,6 +134,11 @@ class ChillMainExtension extends Extension implements
|
||||
$config['access_user_change_password']
|
||||
);
|
||||
|
||||
$container->setParameter(
|
||||
'chill_main.access_permissions_group_list',
|
||||
$config['access_permissions_group_list']
|
||||
);
|
||||
|
||||
$container->setParameter(
|
||||
'chill_main.routing.resources',
|
||||
$config['routing']['resources']
|
||||
|
@ -119,6 +119,9 @@ class Configuration implements ConfigurationInterface
|
||||
->booleanNode('access_user_change_password')
|
||||
->defaultTrue()
|
||||
->end()
|
||||
->booleanNode('access_permissions_group_list')
|
||||
->defaultTrue()
|
||||
->end()
|
||||
->arrayNode('redis')
|
||||
->children()
|
||||
->scalarNode('host')
|
||||
|
@ -34,10 +34,10 @@ use Symfony\Component\Validator\Constraints\Regex;
|
||||
|
||||
class UserType extends AbstractType
|
||||
{
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
ParameterBagInterface $parameterBag
|
||||
@ -91,6 +91,7 @@ class UserType extends AbstractType
|
||||
'query_builder' => static function (EntityRepository $er) {
|
||||
$qb = $er->createQueryBuilder('uj');
|
||||
$qb->where('uj.active = TRUE');
|
||||
|
||||
return $qb;
|
||||
},
|
||||
])
|
||||
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Routing\MenuBuilder;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||
@ -22,9 +23,14 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
public function __construct(
|
||||
AuthorizationCheckerInterface $authorizationChecker,
|
||||
ParameterBagInterface $parameterBag
|
||||
) {
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
$this->parameterBag = $parameterBag;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
@ -51,9 +57,11 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||
'route' => 'admin_scope',
|
||||
])->setExtras(['order' => 1020]);
|
||||
|
||||
$menu->addChild('Permissions group list', [
|
||||
'route' => 'admin_permissionsgroup',
|
||||
])->setExtras(['order' => 1030]);
|
||||
if ($this->parameterBag->get('chill_main.access_permissions_group_list')) {
|
||||
$menu->addChild('Permissions group list', [
|
||||
'route' => 'admin_permissionsgroup',
|
||||
])->setExtras(['order' => 1030]);
|
||||
}
|
||||
|
||||
$menu->addChild('crud.admin_user.index.title', [
|
||||
'route' => 'chill_crud_admin_user_index',
|
||||
|
@ -21,6 +21,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
private NotificationByUserCounter $notificationByUserCounter;
|
||||
|
||||
private Security $security;
|
||||
@ -29,8 +31,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
private WorkflowByUserCounter $workflowByUserCounter;
|
||||
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
public function __construct(
|
||||
NotificationByUserCounter $notificationByUserCounter,
|
||||
WorkflowByUserCounter $workflowByUserCounter,
|
||||
|
Loading…
x
Reference in New Issue
Block a user