-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Support autowiring for AccessDecisionManagerInterface #19684
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
unexge
commented
Aug 20, 2016
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 3.1 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | n/a |
License | MIT |
Doc PR | n/a |
Should be merged as bug fix in 2.8. |
@@ -68,6 +68,11 @@ public function load(array $configs, ContainerBuilder $container) | |||
|
|||
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) { | |||
$loader->load('security_debug.xml'); | |||
|
|||
if ($container->hasDefinition('security.access.decision_manager') && $container->hasDefinition('debug.security.access.decision_manager')) { |
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.
This is not necessary, the last loaded autowiring_types
config will override previous ones. You can just add <autowiring-type>Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface</autowiring-type>
to the debug.security.access.decision_manager
definition and it should do the trick without having to touch the extension.
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 did this first, but it didn't work.
now i did some debugging, and i guess this didn't work because, this is a decorator service.
in this case, this services takes precedence in order:
security.access.decision_manager
debug.security.access.decision_manager
debug.security.access.decision_manager.inner
(which is alias forsecurity.access.decision_manager
)
👍 |
@unexge can you please update the description of your PR to mention a bug fix instead of a new feature. Also you'll need to rebase on 2.8 and change the target branch thanks to new the new Github feature. Note that the DebugAccessDecisionManager has been introduced in 3.1 so this will require some changes. |
@HeahDude if the |
Yes, you need to create 2 PRs. |
@unexge You can do it yourself, using the new GitHub Feature (https://github.com/blog/2224-change-the-base-branch-of-a-pull-request) |
Closing in favor of #21517 |