8000 bug #16695 [SecurityBundle] disable the init:acl command if ACL is no… · symfony/symfony@82b6ec1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 82b6ec1

Browse files
committed
bug #16695 [SecurityBundle] disable the init:acl command if ACL is not used (Tobion)
This PR was merged into the 2.3 branch. Discussion ---------- [SecurityBundle] disable the init:acl command if ACL is not used | Q | A | ------------- | --- | Bug fix? | somewhat | New feature? | somewhat | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | - Related to #16694 but this should go in 2.3 IMO because it was just forgotten. The other acl command already has this logic: https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php#L36 It ensures the command list is not flooded with unusable commands. Commits ------- 55f84a3 [SecurityBundle] disable the init:acl command if ACL is not used
2 parents fd140fc + 55f84a3 commit 82b6ec1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@
2323
*/
2424
class InitAclCommand extends ContainerAwareCommand
2525
{
26+
/**
27+
* {@inheritdoc}
28+
*/
29+
public function isEnabled()
30+
{
31+
if (!$this->getContainer()->has('security.acl.dbal.connection')) {
32+
return false;
33+
}
34+
35+
return parent::isEnabled();
36+
}
37+
2638
/**
2739
* {@inheritdoc}
2840
*/

0 commit comments

Comments
 (0)
0