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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy