Commit 23cd4354 by Julien Jorry

Fix bug => can delete user

parent 050e1ad7
......@@ -20,6 +20,7 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Form\Type\ModelType;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Form\Type\DatePickerType;
use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;
......@@ -39,6 +40,16 @@ class UserAdmin extends BaseUserAdmin
$this->setTemplate('edit', '@SonataAdmin/base_edit.html.twig');
}
protected function configureRoutes(RouteCollection $collection)
{
if ($this->isChild()) {
$collection->remove('delete');
return;
}
// This is the route configuration as a parent
$collection->remove('delete');
}
/**
* {@inheritdoc}
*/
......
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