Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] AllowExpression asAccessDeniedException attribute#46986
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
derrabus commentedJul 20, 2022
|
HypeMC commentedJul 20, 2022
Yes, this is taken from the docs, seehttps://symfony.com/doc/4.4/security/expressions.html
Well yes, but this is just a simple example. The point is that an instance of |
derrabus commentedJul 20, 2022
Amazing. I didn't know about this feature. 😮 |
nicolas-grekas commentedAug 1, 2022
As discussed on#46978, this change looks wrong to me. |
HypeMC commentedAug 1, 2022
@nicolas-grekas Since no one has ever reported this issue, let's close. |
Uh oh!
There was an error while loading.Please reload this page.
Currently the
AccessDeniedException::setAttributes()method accepts a string or an array. However, there are several ways the method could receivean instance ofExpressionas well, eg:On Symfony 5.4 or lower there are no type hints so the object gets cast to an array:
symfony/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php
Lines 37 to 43 inee2eb1c
On 6.0 or higher, because of the added type hints, it gets cast into a string instead.
symfony/src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php
Lines 34 to 37 inc090b9a