Commit be1ee842 by Julien Jorry

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

parent 37824fac
......@@ -355,8 +355,8 @@ services:
tags:
- name: sonata.admin
manager_type: orm
group: "Pages"
label: "Pages"
group: "Import"
label: "Import"
show_mosaic_button: false
public: true
......
......@@ -12,7 +12,6 @@ use App\Enum\MoyenEnum;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\FOSUserEvents;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Knp\Menu\ItemInterface;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
......
......@@ -21,8 +21,10 @@ class GroupAdmin extends BaseGroupAdmin
protected function configureRoutes(RouteCollection $collection)
{
$subject = $this->getSubject();
if ($subject != null && !($subject->isGranted('ROLE_SUPER_ADMIN') || $subject->isGranted('ROLE_ADMIN_SIEGE'))) {
$collection->clearExcept('list');
}
}
public function getBatchActions()
{
......
......@@ -213,7 +213,8 @@ class UserAdmin extends BaseUserAdmin
if ($subject->isGranted('ROLE_COMPTOIR') && !empty($subject->getComptoirsgere())) {
$hideOrShowComptoir = [];
}
$formMapper->with('Groups')
$formMapper
->with('Groups')
->add('groups', ModelType::class, [
'required' => false,
'expanded' => true,
......@@ -231,17 +232,18 @@ class UserAdmin extends BaseUserAdmin
'attr' => $hideOrShowComptoir,
'label_attr' => $hideOrShowComptoir,
])
->end();
$formMapper->end();
->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')
// ->add('token', null, ['required' => false])
// ->add('twoStepVerificationCode', null, ['required' => false])
......
......@@ -267,7 +267,7 @@ abstract class Flux
$em = $event->getEntityManager();
$flux->getExpediteur()->setCompte($compteExp);
$em->persist($flux->getExpediteur());
if ($this->getParenttype() != 'vente') {
if ($flux->getParenttype() != 'vente') {
$compteDest = $flux->getDestinataire()->getCompte() + $flux->getMontant();
$flux->getDestinataire()->setCompte($compteDest);
$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