-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Api] restrict access to customer account editing #11874
[Api] restrict access to customer account editing #11874
Conversation
AdamKasp
commented
Sep 24, 2020
Q | A |
---|---|
Branch? | master |
Bug fix? | no/yes |
New feature? | no/yes |
BC breaks? | no/yes |
Deprecations? | no |
Related tickets | part of #11250, based on #11872 |
License | MIT |
} | ||
|
||
if ( | ||
$user instanceof ShopUserInterface && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$user instanceof ShopUserInterface && | |
$user instanceof ShopUserInterface && | |
in_array('ROLE_USER', $user->getRoles(), true)) && |
@@ -6,10 +6,10 @@ Feature: Editing a customer profile | |||
|
|||
Background: | |||
Given the store operates on a single channel in "United States" | |||
And there is a customer "Francis Underwood" identified by an email "[email protected]" and a password "whitehouse" | |||
And there is a customer "Francis Underwood" identified by an email "[email protected]" and a password "sylius" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And there is a customer "Francis Underwood" identified by an email "[email protected]" and a password "sylius" | |
And there is a customer "Francis Underwood" identified by an email "[email protected]" |
IMO its not needed in plain sight
/** @var ShopUserInterface $shopUser */ | ||
$shopUser = $this->sharedStorage->get('user'); | ||
|
||
$this->shopApiSecurityContext->iAmLoggedInAs($email); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is different behaviour than in UI, for now, it's ok, but we should probably think about it in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i will investigate how to save token
after customer change login, and i will add new PR with solution or add issue for it.
->getItem( | ||
CustomerInterface::class, | ||
'2', | ||
Request::METHOD_PUT, | ||
[] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be, but in rest of item providers we have similar formating and also IMO it is more readable in this way
Thank you, Adam! 🎉 |