-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] make ACL an optional dependency #16694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t 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
Thank you @Tobion. |
This PR was merged into the 3.0-dev branch. Discussion ---------- [SecurityBundle] make ACL an optional dependency | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | - Fixes #14718 (comment). Together with doctrine/DoctrineCacheBundle#77 we do not have ACL in the symfony-standard 3.0 by default anymore. Commits ------- fc66283 [SecurityBundle] make ACL an optional dependency
@@ -116,6 +116,10 @@ public function load(array $configs, ContainerBuilder $container) | |||
|
|||
private function aclLoad($config, ContainerBuilder $container) | |||
{ | |||
if (!interface_exists('Symfony\Component\Security\Acl\Model\AclInterface')) { | |||
throw new \LogicException('You must install symfony/security-acl in order to use the ACL functionality.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be \RuntimeException()
IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter and its the same as in doctrine/DoctrineCacheBundle#77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer logic :-)
Fixes #14718 (comment).
Together with doctrine/DoctrineCacheBundle#77 we do not have ACL in the symfony-standard 3.0 by default anymore.