File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Persistent/Model/Customer Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 4
4
* Copyright © Magento, Inc. All rights reserved.
5
5
* See COPYING.txt for license details.
6
6
*/
7
+ declare (strict_types=1 );
7
8
8
9
namespace Magento \Customer \Model \Customer ;
9
10
@@ -64,17 +65,16 @@ public function __construct(
64
65
*/
65
66
public function isAllowed ($ resource , $ privilege = null )
66
67
{
67
- if ($ resource == AuthorizationService::PERMISSION_SELF
68
+ if ($ resource === AuthorizationService::PERMISSION_SELF
68
69
&& $ this ->userContext ->getUserId ()
69
70
&& $ this ->userContext ->getUserType () === UserContextInterface::USER_TYPE_CUSTOMER
70
71
) {
71
72
$ customer = $ this ->customerFactory ->create ();
72
73
$ this ->customerResource ->load ($ customer , $ this ->userContext ->getUserId ());
73
74
$ currentStoreId = $ this ->storeManager ->getStore ()->getId ();
74
75
$ sharedStoreIds = $ customer ->getSharedStoreIds ();
75
- if (in_array ($ currentStoreId , $ sharedStoreIds )) {
76
- return true ;
77
- }
76
+
77
+ return in_array ($ currentStoreId , $ sharedStoreIds );
78
78
}
79
79
80
80
return false ;
Original file line number Diff line number Diff line change 4
4
* Copyright © Magento, Inc. All rights reserved.
5
5
* See COPYING.txt for license details.
6
6
*/
7
+ declare (strict_types=1 );
7
8
8
9
namespace Magento \Customer \Model \Customer ;
9
10
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
6
7
7
8
namespace Magento \Persistent \Model \Customer ;
8
9
You can’t perform that action at this time.
0 commit comments