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
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- 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] 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)
|
||||||
|
@ -38,6 +38,8 @@ class UserController extends CRUDController
|
|||||||
{
|
{
|
||||||
public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
||||||
|
|
||||||
|
protected ParameterBagInterface $parameterBag;
|
||||||
|
|
||||||
private LoggerInterface $logger;
|
private LoggerInterface $logger;
|
||||||
|
|
||||||
private UserPasswordEncoderInterface $passwordEncoder;
|
private UserPasswordEncoderInterface $passwordEncoder;
|
||||||
@ -46,8 +48,6 @@ class UserController extends CRUDController
|
|||||||
|
|
||||||
private ValidatorInterface $validator;
|
private ValidatorInterface $validator;
|
||||||
|
|
||||||
protected ParameterBagInterface $parameterBag;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
LoggerInterface $chillLogger,
|
LoggerInterface $chillLogger,
|
||||||
ValidatorInterface $validator,
|
ValidatorInterface $validator,
|
||||||
|
@ -134,6 +134,11 @@ class ChillMainExtension extends Extension implements
|
|||||||
$config['access_user_change_password']
|
$config['access_user_change_password']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$container->setParameter(
|
||||||
|
'chill_main.access_permissions_group_list',
|
||||||
|
$config['access_permissions_group_list']
|
||||||
|
);
|
||||||
|
|
||||||
$container->setParameter(
|
$container->setParameter(
|
||||||
'chill_main.routing.resources',
|
'chill_main.routing.resources',
|
||||||
$config['routing']['resources']
|
$config['routing']['resources']
|
||||||
|
@ -119,6 +119,9 @@ class Configuration implements ConfigurationInterface
|
|||||||
->booleanNode('access_user_change_password')
|
->booleanNode('access_user_change_password')
|
||||||
->defaultTrue()
|
->defaultTrue()
|
||||||
->end()
|
->end()
|
||||||
|
->booleanNode('access_permissions_group_list')
|
||||||
|
->defaultTrue()
|
||||||
|
->end()
|
||||||
->arrayNode('redis')
|
->arrayNode('redis')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('host')
|
->scalarNode('host')
|
||||||
|
@ -34,10 +34,10 @@ use Symfony\Component\Validator\Constraints\Regex;
|
|||||||
|
|
||||||
class UserType extends AbstractType
|
class UserType extends AbstractType
|
||||||
{
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
|
||||||
|
|
||||||
protected ParameterBagInterface $parameterBag;
|
protected ParameterBagInterface $parameterBag;
|
||||||
|
|
||||||
|
private TranslatableStringHelper $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
TranslatableStringHelper $translatableStringHelper,
|
||||||
ParameterBagInterface $parameterBag
|
ParameterBagInterface $parameterBag
|
||||||
@ -91,6 +91,7 @@ class UserType extends AbstractType
|
|||||||
'query_builder' => static function (EntityRepository $er) {
|
'query_builder' => static function (EntityRepository $er) {
|
||||||
$qb = $er->createQueryBuilder('uj');
|
$qb = $er->createQueryBuilder('uj');
|
||||||
$qb->where('uj.active = TRUE');
|
$qb->where('uj.active = TRUE');
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Routing\MenuBuilder;
|
|||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
|
|
||||||
class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
@ -22,9 +23,14 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
*/
|
*/
|
||||||
protected $authorizationChecker;
|
protected $authorizationChecker;
|
||||||
|
|
||||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
protected ParameterBagInterface $parameterBag;
|
||||||
{
|
|
||||||
|
public function __construct(
|
||||||
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
|
ParameterBagInterface $parameterBag
|
||||||
|
) {
|
||||||
$this->authorizationChecker = $authorizationChecker;
|
$this->authorizationChecker = $authorizationChecker;
|
||||||
|
$this->parameterBag = $parameterBag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
@ -51,9 +57,11 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'route' => 'admin_scope',
|
'route' => 'admin_scope',
|
||||||
])->setExtras(['order' => 1020]);
|
])->setExtras(['order' => 1020]);
|
||||||
|
|
||||||
$menu->addChild('Permissions group list', [
|
if ($this->parameterBag->get('chill_main.access_permissions_group_list')) {
|
||||||
'route' => 'admin_permissionsgroup',
|
$menu->addChild('Permissions group list', [
|
||||||
])->setExtras(['order' => 1030]);
|
'route' => 'admin_permissionsgroup',
|
||||||
|
])->setExtras(['order' => 1030]);
|
||||||
|
}
|
||||||
|
|
||||||
$menu->addChild('crud.admin_user.index.title', [
|
$menu->addChild('crud.admin_user.index.title', [
|
||||||
'route' => 'chill_crud_admin_user_index',
|
'route' => 'chill_crud_admin_user_index',
|
||||||
|
@ -21,6 +21,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
|
protected ParameterBagInterface $parameterBag;
|
||||||
|
|
||||||
private NotificationByUserCounter $notificationByUserCounter;
|
private NotificationByUserCounter $notificationByUserCounter;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
@ -29,8 +31,6 @@ 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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user