fix-admin and crudify user admin

This commit is contained in:
2021-09-22 18:18:49 +02:00
parent f93c2d8d32
commit b5c2dd7bd2
21 changed files with 247 additions and 185 deletions

View File

@@ -19,10 +19,13 @@
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\UserController;
use Chill\MainBundle\Doctrine\DQL\STContains;
use Chill\MainBundle\Doctrine\DQL\StrictWordSimilarityOPS;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\UserJobType;
use Chill\MainBundle\Form\UserType;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
@@ -283,13 +286,33 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
'template' => '@ChillMain/UserJob/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN'
'role' => 'ROLE_ADMIN'
],
'edit' => [
'role' => 'ROLE_ADMIN'
]
],
],
[
'class' => User::class,
'controller' => UserController::class,
'name' => 'admin_user',
'base_path' => '/admin/main/user2',
'base_role' => 'ROLE_ADMIN',
'form_class' => UserType::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/User/index.html.twig'
],
'new' => [
'role' => 'ROLE_ADMIN',
],
'edit' => [
'role' => 'ROLE_ADMIN',
]
]
]
],
'apis' => [
[