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

Fixing docs about switch_user and custom voters#11653

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
javiereguiluz merged 1 commit intosymfony:4.2fromweaverryan:fix-impersonation
Jun 4, 2019

Conversation

@weaverryan
Copy link
Member

@nicolas-grekas caught this. We need to use a custom attribute, instead of relying onROLE_ALLOWED_TO_SWITCH. Otherwise, it's possible for theRoleVoter to say "Yes! This persondoes haveROLE_ALLOWED_TO_SWITCH"... but then your custom voter is never called, which would then say "Wait, no, they should not". A bit of an edge case - but this strategy gives the user 100% control, which is generally what we want with voters: only 1 voter should vote, not multiple.

Was introduced originally in 4.1.

@javiereguiluz
Copy link
Member

Thanks Ryan.

@javiereguiluzjaviereguiluz merged commit3f2e67d intosymfony:4.2Jun 4, 2019
javiereguiluz added a commit that referenced this pull requestJun 4, 2019
…yan)This PR was merged into the 4.2 branch.Discussion----------Fixing docs about switch_user and custom voters@nicolas-grekas caught this. We need to use a custom attribute, instead of relying on `ROLE_ALLOWED_TO_SWITCH`. Otherwise, it's possible for the `RoleVoter` to say "Yes! This person *does* have `ROLE_ALLOWED_TO_SWITCH`"... but then your custom voter is never called, which would then say "Wait, no, they should not". A bit of an edge case - but this strategy gives the user 100% control, which is generally what we want with voters: only 1 voter should vote, not multiple.Was introduced originally in 4.1.Commits-------3f2e67d Fixing docs about switch_user and custom voters
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

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

4 participants

@weaverryan@javiereguiluz@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp