-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle][2.8] Support autowiring for AccessDecisionManagerInterface #19941
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
$container = static::$kernel->getContainer(); | ||
|
||
$accessDecisionManager = $container->get('test.autowiring_types.autowired_services')->getAccessDecisionManager(); | ||
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\AccessDecisionManager', $accessDecisionManager); |
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.
Can you also add a test-case where the debug variant is retrieved in debug/dev?
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.
added, 2f6a92b.
$container = static::$kernel->getContainer(); | ||
|
||
$accessDecisionManager = $container->get('test.autowiring_types.autowired_services')->getAccessDecisionManager(); | ||
$this->assertInstanceOf('Symfony\Component\Security\Core\Authorization\AccessDecisionManager', $accessDecisionManager); |
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.
When in debug, it should be an instance of Symfony\Component\Security\Core\Authorization\DebugAccessDecisionManager
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.
yes, this case exist in #19684 (targeted 3.1).
see #19684 (comment),
DebugAccessDecisionManager has been introduced in 3.1
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.
Ah I thought this was a feature, nevertheless, good to have this test so we will notice it breaks in 3.1 and it can be fixed there.
I think it's correct that autowiring are allowed in lower versions, but I'm not sure. Following semver it would not be allowed because if you rely on the functionality and you go back 1 patch due to a bug fix bug, you also break this "feature".
I agree with @iltar, I think it's a new feature and should not be backported to 2.8. It's not blocking anyway because the service can still be injected "manually", even with a definition having |
I think you're right. We've been to lax lately when merging such things in older branches. |
port of #19684 for 2.8