Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 860d86a

Browse filesBrowse files
bug #48032 [SecurityBundle] Set UserValueResolver's priority higher than EntityValueResolver (kbond)
This PR was merged into the 6.2 branch. Discussion ---------- [SecurityBundle] Set `UserValueResolver`'s priority higher than `EntityValueResolver` | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a `UserValueResolver`'s priority is currently `40` and `EntityValueResolver`'s priority is `110` (configured in doctrine-bundle). Currently, to use the `CurrentUser` attribute and `MapEntity` (when `auto_mapping` is enabled), you need to do the following to have it work: ```php public function postAction( #[CurrentUser] #[MapEntity(disabled: true)] User $user, Post $post ) ``` This removes this need for `#[MapEntity(disabled: true)]` but I'm not sure the larger impact of increasing the priority of `UserValueResolver`. Here is some context as to why the priorities are they way they are: - doctrine/DoctrineBundle#1554 (comment) - #18510 Commits ------- 48499b9 Set `UserValueResolver`'s priority higher than `EntityValueResolver`
2 parents 2eed84b + 48499b9 commit 860d86a
Copy full SHA for 860d86a

File tree

1 file changed

+1
-1
lines changed
Filter options
  • src/Symfony/Bundle/SecurityBundle/Resources/config

1 file changed

+1
-1
lines changed

‎src/Symfony/Bundle/SecurityBundle/Resources/config/security.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Resources/config/security.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
->args([
101101
service('security.token_storage'),
102102
])
103-
->tag('controller.argument_value_resolver', ['priority' => 40])
103+
->tag('controller.argument_value_resolver', ['priority' => 120])
104104

105105
// Authentication related services
106106
->set('security.authentication.trust_resolver', AuthenticationTrustResolver::class)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.