Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[SecurityBundle] SetUserValueResolver's priority higher thanEntityValueResolver#48032

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

Merged

Conversation

@kbond
Copy link
Member

@kbondkbond commentedOct 28, 2022
edited
Loading

QA
Branch?6.2
Bug fix?no
New feature?no
Deprecations?no
Ticketsn/a
LicenseMIT
Doc PRn/a

UserValueResolver's priority is currently40 andEntityValueResolver's priority is110 (configured in doctrine-bundle).

Currently, to use theCurrentUser attribute andMapEntity (whenauto_mapping is enabled), you need to do the following to have it work:

publicfunction 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 ofUserValueResolver. Here is some context as to why the priorities are they way they are:

@carsonbot
Copy link

Hey!

I think@johnkrovitch has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@stof
Copy link
Member

stof commentedNov 9, 2022

The impact would be that if you have a parameter typehinted asUserInterface or tagged asCurrentUser that has the same name than a request attribute, the UserValueResolver would now apply instead of the RequestAttributeResolver. But this is more likely to fix bugs (or at least fix DX confusion) than to introduce it (if you tag asCurrentUser, you make the intent clear that you expect the current user and not the request attribute nameduser)

nicolas-grekas and kbond reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

Thank you@kbond.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof approved these changes

@wouterjwouterjAwaiting requested review from wouterjwouterj is a code owner

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

4 participants

@kbond@carsonbot@stof@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp