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] Allow using expressions with the #[IsGranted] attribute#46978
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
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/Tests/EventListener/IsGrantedAttributeListenerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
bdd0c16 to3957a98Comparesrc/Symfony/Component/Security/Http/Tests/EventListener/IsGrantedAttributeListenerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
$accessDeniedException->setAttributes($attribute->attributes);
Don't we want to provide the resolved values instead? That would solve the issue with accepting Expression into AccessDeniedException and might improve debugging?
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
7c38656 to3d81940Compare
@nicolas-grekas The problem is that the attributes expression is evaluated by the symfony/src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php Lines 67 to 74 in9d7ff0c
Also, if I'm not mistaking, the result of the expression is always |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas Was this closed by accident or did I miss something ? |
Indeed, this is a mistake because of the other PR description |
Thank you@HypeMC. |
… (HypeMC)This PR was merged into the 6.2 branch.Discussion----------[Security] Use expression for `#[IsGranted()]` subjectsymfony/symfony#46978symfony/symfony#48080symfony/symfony#48102Commits-------9d4045f [Security] Use expression for #[IsGranted()] subject
… (HypeMC)This PR was merged into the 6.2 branch.Discussion----------[Security] Use expression for `#[IsGranted()]` subjectsymfony/symfony#46978symfony/symfony#48080symfony/symfony#48102Commits-------9d4045f [Security] Use expression for #[IsGranted()] subject
Uh oh!
There was an error while loading.Please reload this page.
Allows using the expression language with the
#[IsGranted]attribute: