-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] #[MapEntity]
is "handled" before #[IsGranted]
#58827
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
I fail to see the problem. Can you elaborate more? |
I did a test again and with the code copied in this issue, I have the error. You have to click in the profiler once we are redirected. For the example, I clicked on the link "bc5bd7", and I see the Doctrine tab in the profiler. |
I know how to use the profiler, thank you. But so far, you're only describing observed behavior and not why that behavior is a problem. |
Sorry I'm not in front of my laptop: I think we already discussed this topic, can someone find anything? |
I think you mean #50120 |
Yes, it seems related to #50120. |
This behavior is a problem because the query is executed while I am not authorized to execute the function because I am an anonymous user. |
Other than that we are running a redundant query (thus causing unnecessary load on the database), there is not much wrong with running the query - given IsGranted will prevent Symfony or your app to do anything with its result. I think the latter is what @derrabus is referring too. Still, I think it would be good if we can somehow fix this (or maybe the patch from the other issue already does?), as this opens the door to potential ddos-able endpoints. |
Unfortunately, the patch from the other issue does not fix this. |
if performance is the concern, it might be better to not use |
Symfony version(s) affected
7.1.1
Description
#[MapEntity]
is "handled" before#[IsGranted]
.How to reproduce
src/Controller/Admin/BlogController.php
, replaceindex()
function byPossible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: