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

[Security] #25091 add target user to SwitchUserListener#25092

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

Closed
jwmickey wants to merge5 commits intosymfony:masterfromjwmickey:25091_switch_user
Closed

[Security] #25091 add target user to SwitchUserListener#25092

jwmickey wants to merge5 commits intosymfony:masterfromjwmickey:25091_switch_user

Conversation

@jwmickey
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#25091
LicenseMIT
Doc PR

This patch provides the target user to the SwitchUserListener's
accessDecisionManager->decide() call as the $object parameter to
give any registered voters extra information.

===================

* feature#25091[Security] Add target user to SwitchUserListener (jwmickey)

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add this, will be done automatically when the version is released after merging.

Copy link
Member

Choose a reason for hiding this comment

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

@iltar is right. But you need to add the feature to the component's changelog instead.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I will move the changelog note to the correct file, thank you.

}

if (null !==$this->logger) {
$this->logger->info('Attempting to switch to user.',array('username' =>$username));
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this give the wrong username as result now?

Copy link
Member

Choose a reason for hiding this comment

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

I wonder why we would need to do the change on line 129 instead.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I don't think it will give the wrong username, but I did notice that I removed the line that sets attributes on the exception, so I'll add that back in.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@iltar, my apologies, the code I submitted did indeed change the username for JSON requests. The problem stemmed from me originally starting from the 2.7 branch and then rebasing to master, and I ended up changing some code from 2.7 that was different in master without realizing... in any case, lesson learned and thanks for pointing this out

linaori reacted with hooray emoji
@nicolas-grekasnicolas-grekas added this to the4.1 milestoneNov 22, 2017
@xabbuh
Copy link
Member

Can you please rebase on currentmaster? Tests are currently failing.

This patch provides the target user to the SwitchUserListener'saccessDecisionManager->decide() call as the $object parameter togive any registered voters extra information.
- moved message from the general changelog to the security component'schangelog- restored exception attributes that were mistakenly removed
@jwmickey
Copy link
ContributorAuthor

Is there anything else I need to do for this PR?

if (false ===$this->accessDecisionManager->decide($token,array($this->role),$user)) {
$exception =newAccessDeniedException();
$exception->setAttributes($this->role);

Copy link
Member

Choose a reason for hiding this comment

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

this change should be reverted

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Why should this change be reverted?

Copy link
Member

Choose a reason for hiding this comment

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

Because it's not needed.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'm sorry, I don't follow. Are you saying that the $user param does not need to be passed to the accessDecisionManager->decide() call as the 3rd parameter?

Copy link
Member

Choose a reason for hiding this comment

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

Oh that's a misunderstanding then. I was just referring to the blank line which should not have been removed.

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

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

apart from my minor comment

@chalasr
Copy link
Member

Thank you@jwmickey and congratz for your first contribution on Symfony!

linaori reacted with thumbs up emoji

@jwmickey
Copy link
ContributorAuthor

Whoohoo! Thank you@chalasr, very exciting!

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

Reviewers

@fabpotfabpotfabpot left review comments

@xabbuhxabbuhxabbuh approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@linaorilinaorilinaori left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

7 participants

@jwmickey@xabbuh@chalasr@fabpot@linaori@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp