-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Custom Expression Language function not working in security.yml allow_if #23208
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
Comments
Can you provide a small example project that makes it possible to reproduce your issue? |
Status: Reviewed |
Thanks, I can confirm the issue. The |
The natural solution in my mind is to move the parsing of authorization-related expression so that at least compiler passes are processed first. It seems incredibly early to parse the expressions at that stage. Is there any good reason why it must be done that way or is it an oversight? |
I ran into the same problem today and opened a PR to discuss possible solutions: #24309 |
Still not fixed ? :-( |
@syrm Apparently, nobody took the time to investigate the issue to find a solution and propose a pull request. |
@syrm I came up with an idea but it was not optimal 😢 Did not have time yet to re-check. |
thank you everyone for your answers |
See #26660 |
…low_if expressions (dmaicher) This PR was merged into the 4.1-dev branch. Discussion ---------- [SecurityBundle] allow using custom function inside allow_if expressions | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | no | Fixed tickets | #23208 | License | MIT | Doc PR | symfony/symfony-docs#9552 This is a follow-up for #26263 As discussed there I propose to allow using custom functions as a new feature only and thus targeting `master` here. If we agree to move forward with this there are some todos: - [x] fix tests - [x] add cache warmer for allow_if expressions - [x] update documentation to mention this new feature - [x] update UPGRADE files ping @nicolas-grekas @stof Commits ------- 41552cd [SecurityBundle] allow using custom function inside allow_if expressions
It's exactly the same problem of this issue : #21305
Except i using it in securty.yml allow_if and i got :
Error: The function "test" does not exist around position 1.
With @Security annotation everything is ok.
The text was updated successfully, but these errors were encountered: