Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[SecurityBundle] fixed DebugAccessDecisionManager config#18566
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
HeahDude commentedApr 16, 2016
| Q | A |
|---|---|
| Branch? | master |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #18554 |
| License | MIT |
| Doc PR | ~ |
linaori commentedApr 16, 2016
This is not the way you're supposed to define the decorator. In fact, I would expect this to inject itself and cause a recursive dependency. Maybe there's another bug at hand causing this or is this intended behavior? |
HeahDude commentedApr 16, 2016
@iltar, I'm not an expert of the DI component but this seems logical if we consider that the decoration is also "hardcoded", seehere andhere. If I understand correctly, if the container handles the debug adm as a decorator it is automatically injected and those lines should not be needed, am I missing something ? This is also how the decorated choice list factories are defined (without using the |
gharlan commentedApr 18, 2016
@HeahDude thanks for working on this. I can confirm that it fixes the issue. (But I don't know if it is the "correct" way to fix it.) |
ghost commentedApr 20, 2016
This fix works fine here. Please merge it. 👍 |
stof commentedApr 20, 2016
The fix does not work fine. It simply means that the debug service will never be used, as it does not replace the original service with the decorated version, making it useless. so this PR does not fix a bug. It breaks the feature entirely. |
HeahDude commentedApr 20, 2016
stof commentedApr 20, 2016
@HeahDude but do you still get the votes in the profiler ? This is what the debug decorator is about. |
HeahDude commentedApr 20, 2016
Yes it works perfectly fine :) |
HeahDude commentedApr 20, 2016
Can anyone else (re-)confirm? ping @JHGitty@gharlan |
gharlan commentedApr 20, 2016
Yes I can confirm it. It fixes the bug, and the new access decision log in profiler is still there. |
HeahDude commentedApr 20, 2016
Thank you@gharlan |
xabbuh commentedApr 21, 2016
@stof This works for the core as the injected access decision manager is changed manually in the extension class:https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L100-L105 However, this will not work if someone injected the default access decision manager somewhere else as those places would now not use the decorated one anymore. |
linaori commentedApr 21, 2016
One solution could be the following delegator class in dev: @Internalfinalclass VoterProxyimplements VoterInterface{private$voterId;private$container;publicfunction__construct($voterId,ContainerInterface$container) {$this->voterId =$voterId;$this->container =$container; }publicfunctionvote(TokenInterface$token,$subject,array$attributes) {return$this->container->get($this->voterId)->vote($token,$subject,$attributes); }} Imo this is the only "clean" solution will will keep working in the future, possible even in prod (though you might want to cache the container get call then) |
HeahDude commentedApr 24, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ok I've reverted the first fix ina6fce2d and pushed8e4f98b to fix it while keeping the debug adm injected properly, considering the good point of@xabbuh. I've tested it was passed to the If some one could test it again, we should be good now :) |
HeahDude commentedApr 24, 2016
Actually, the test with the collector is extra safety, since the feature works without overriding |
HeahDude commentedApr 25, 2016
HeahDude commentedApr 25, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Isn't the "critical" label needed when a BC break prevents the application from running? |
gharlan commentedApr 25, 2016
HeahDude commentedApr 25, 2016
Thank you@gharlan, again :) |
fabpot commentedApr 28, 2016
Thank you@HeahDude. |
…HeahDude)This PR was squashed before being merged into the 3.1-dev branch (closes#18566).Discussion----------[SecurityBundle] fixed DebugAccessDecisionManager config| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#18554| License | MIT| Doc PR | ~Commits-------53c78fe [SecurityBundle] fixed DebugAccessDecisionManager config