Skip to content

Commit 272dcf6

Browse files
author
Roman Lytvynenko
committed
MC-36647: Order can be placed as a customer after session cookie expiration with Persistent Cart enabled
1 parent ee17be2 commit 272dcf6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/code/Magento/Customer/Model/Customer/Authorization.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
78

89
namespace Magento\Customer\Model\Customer;
910

@@ -64,17 +65,16 @@ public function __construct(
6465
*/
6566
public function isAllowed($resource, $privilege = null)
6667
{
67-
if ($resource == AuthorizationService::PERMISSION_SELF
68+
if ($resource === AuthorizationService::PERMISSION_SELF
6869
&& $this->userContext->getUserId()
6970
&& $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER
7071
) {
7172
$customer = $this->customerFactory->create();
7273
$this->customerResource->load($customer, $this->userContext->getUserId());
7374
$currentStoreId = $this->storeManager->getStore()->getId();
7475
$sharedStoreIds = $customer->getSharedStoreIds();
75-
if (in_array($currentStoreId, $sharedStoreIds)) {
76-
return true;
77-
}
76+
77+
return in_array($currentStoreId, $sharedStoreIds);
7878
}
7979

8080
return false;

app/code/Magento/Customer/Model/Customer/AuthorizationComposite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
78

89
namespace Magento\Customer\Model\Customer;
910

app/code/Magento/Persistent/Model/Customer/Authorization.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Persistent\Model\Customer;
89

0 commit comments

Comments
 (0)