From ce87f98379e1627ab44560b667999ac34ef56c62 Mon Sep 17 00:00:00 2001 From: Tadas Rimkus Date: Fri, 18 Mar 2022 17:50:15 +0100 Subject: [PATCH] Add extra check for AclBundle We only need to fail fast if: - bundle does not exist - parameter is missing This means if we use AclBundle we will succeed this check. If we use some other bundle to manage ACL and have configured provider, we can set the parameter and pass the second check. --- src/DependencyInjection/SonataAdminExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/SonataAdminExtension.php b/src/DependencyInjection/SonataAdminExtension.php index 89e68e455b7..fec7808341b 100644 --- a/src/DependencyInjection/SonataAdminExtension.php +++ b/src/DependencyInjection/SonataAdminExtension.php @@ -144,7 +144,7 @@ public function load(array $configs, ContainerBuilder $container): void break; case 'sonata.admin.security.handler.acl': - if (!$container->hasParameter('security.acl.provider')) { + if (!isset($bundles['AclBundle']) && !$container->hasParameter('security.acl.provider')) { throw new \RuntimeException( 'The "security.acl.provider" service is needed to use ACL as security handler.' .' You MUST install and enable the "symfony/acl-bundle" bundle.'