mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
fix-admin and crudify user admin
This commit is contained in:
@@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
@@ -33,30 +33,31 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$menu->addChild('Users and permissions', [
|
||||
'route' => 'chill_main_admin_permissions'
|
||||
])
|
||||
->setExtras([
|
||||
'icons' => ['key'],
|
||||
'order' => 200
|
||||
'order' => 200,
|
||||
'explain' => "Configure permissions for users"
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return [ 'admin_section' ];
|
||||
return [ 'admin_section', 'admin_index' ];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user