File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
app/code/Magento/Webapi/Model/Plugin Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+ declare (strict_types=1 );
67
78namespace Magento \Webapi \Model \Plugin ;
89
1112/**
1213 * Plugin around \Magento\Framework\Authorization::isAllowed
1314 *
14- * Plugin to allow guest users to access resources with anonymous permission
15+ * Allow guest users to access resources with " anonymous" resource
1516 */
1617class GuestAuthorization
1718{
@@ -22,8 +23,7 @@ class GuestAuthorization
2223 * @param \Closure $proceed
2324 * @param string $resource
2425 * @param string $privilege
25- * @return bool true If resource permission is anonymous,
26- * to allow any user access without further checks in parent method
26+ * @return bool Is resource permission "anonymous", to allow any user access without further checks in parent method
2727 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2828 */
2929 public function aroundIsAllowed (
@@ -32,10 +32,10 @@ public function aroundIsAllowed(
3232 $ resource ,
3333 $ privilege = null
3434 ) {
35- if ($ resource == AuthorizationService::PERMISSION_ANONYMOUS ) {
35+ if ($ resource === AuthorizationService::PERMISSION_ANONYMOUS ) {
3636 return true ;
37- } else {
38- return $ proceed ($ resource , $ privilege );
3937 }
38+
39+ return $ proceed ($ resource , $ privilege );
4040 }
4141}
You can’t perform that action at this time.
0 commit comments