IS there a simple way to disable some CRUD actions for given admin class? E.g. I just want a list of users added via front-end without the option to manually add them.
rpg600
In your admin class :
protected function configureRoutes(RouteCollection $collection)
{
// to remove a single route
$collection->remove('delete');
// OR remove all route except named ones
$collection->clearExcept(array('list', 'show'));
}
Also use routeCollection at top of admin class
use Sonata\AdminBundle\Route\RouteCollection;
Docs : http://sonata-project.org/bundles/admin/master/doc/reference/routing.html#removing-a-single-route
来源:https://stackoverflow.com/questions/18288519/disable-action-in-sonata-admin-bundle-crud