Skip to content

Commit

Permalink
Add extra check for AclBundle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Buratinas committed Mar 18, 2022
1 parent de08d94 commit ce87f98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DependencyInjection/SonataAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down

0 comments on commit ce87f98

Please sign in to comment.