Commit be1ee842 by Julien Jorry

BO : add page(s) admin + fix role admin for super admin

parent 37824fac
...@@ -355,8 +355,8 @@ services: ...@@ -355,8 +355,8 @@ services:
tags: tags:
- name: sonata.admin - name: sonata.admin
manager_type: orm manager_type: orm
group: "Pages" group: "Import"
label: "Pages" label: "Import"
show_mosaic_button: false show_mosaic_button: false
public: true public: true
......
...@@ -12,7 +12,6 @@ use App\Enum\MoyenEnum; ...@@ -12,7 +12,6 @@ use App\Enum\MoyenEnum;
use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\FOSUserEvents;
use Knp\Menu\ItemInterface as MenuItemInterface; use Knp\Menu\ItemInterface as MenuItemInterface;
use Knp\Menu\ItemInterface;
use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Admin\AdminInterface; use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper;
......
...@@ -21,8 +21,10 @@ class GroupAdmin extends BaseGroupAdmin ...@@ -21,8 +21,10 @@ class GroupAdmin extends BaseGroupAdmin
protected function configureRoutes(RouteCollection $collection) protected function configureRoutes(RouteCollection $collection)
{ {
$subject = $this->getSubject(); $subject = $this->getSubject();
if ($subject != null && !($subject->isGranted('ROLE_SUPER_ADMIN') || $subject->isGranted('ROLE_ADMIN_SIEGE'))) {
$collection->clearExcept('list'); $collection->clearExcept('list');
} }
}
public function getBatchActions() public function getBatchActions()
{ {
......
...@@ -213,7 +213,8 @@ class UserAdmin extends BaseUserAdmin ...@@ -213,7 +213,8 @@ class UserAdmin extends BaseUserAdmin
if ($subject->isGranted('ROLE_COMPTOIR') && !empty($subject->getComptoirsgere())) { if ($subject->isGranted('ROLE_COMPTOIR') && !empty($subject->getComptoirsgere())) {
$hideOrShowComptoir = []; $hideOrShowComptoir = [];
} }
$formMapper->with('Groups') $formMapper
->with('Groups')
->add('groups', ModelType::class, [ ->add('groups', ModelType::class, [
'required' => false, 'required' => false,
'expanded' => true, 'expanded' => true,
...@@ -231,17 +232,18 @@ class UserAdmin extends BaseUserAdmin ...@@ -231,17 +232,18 @@ class UserAdmin extends BaseUserAdmin
'attr' => $hideOrShowComptoir, 'attr' => $hideOrShowComptoir,
'label_attr' => $hideOrShowComptoir, 'label_attr' => $hideOrShowComptoir,
]) ])
->end(); ->end()
$formMapper->end(); ->with('Roles')
->add('realRoles', SecurityRolesType::class, [
'label' => 'form.label_roles',
'expanded' => true,
'multiple' => true,
'required' => false,
])
->end()
->end()
;
} }
// ->with('Roles')
// ->add('realRoles', SecurityRolesType::class, [
// 'label' => 'form.label_roles',
// 'expanded' => true,
// 'multiple' => true,
// 'required' => false,
// ])
// ->end()
// ->with('Keys') // ->with('Keys')
// ->add('token', null, ['required' => false]) // ->add('token', null, ['required' => false])
// ->add('twoStepVerificationCode', null, ['required' => false]) // ->add('twoStepVerificationCode', null, ['required' => false])
......
...@@ -267,7 +267,7 @@ abstract class Flux ...@@ -267,7 +267,7 @@ abstract class Flux
$em = $event->getEntityManager(); $em = $event->getEntityManager();
$flux->getExpediteur()->setCompte($compteExp); $flux->getExpediteur()->setCompte($compteExp);
$em->persist($flux->getExpediteur()); $em->persist($flux->getExpediteur());
if ($this->getParenttype() != 'vente') { if ($flux->getParenttype() != 'vente') {
$compteDest = $flux->getDestinataire()->getCompte() + $flux->getMontant(); $compteDest = $flux->getDestinataire()->getCompte() + $flux->getMontant();
$flux->getDestinataire()->setCompte($compteDest); $flux->getDestinataire()->setCompte($compteDest);
$em->persist($flux->getDestinataire()); $em->persist($flux->getDestinataire());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment