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 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 \Webapi \Model \Plugin ;
8
9
11
12
/**
12
13
* Plugin around \Magento\Framework\Authorization::isAllowed
13
14
*
14
- * Plugin to allow guest users to access resources with anonymous permission
15
+ * Allow guest users to access resources with " anonymous" resource
15
16
*/
16
17
class GuestAuthorization
17
18
{
@@ -22,8 +23,7 @@ class GuestAuthorization
22
23
* @param \Closure $proceed
23
24
* @param string $resource
24
25
* @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
27
27
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
28
28
*/
29
29
public function aroundIsAllowed (
@@ -32,10 +32,10 @@ public function aroundIsAllowed(
32
32
$ resource ,
33
33
$ privilege = null
34
34
) {
35
- if ($ resource == AuthorizationService::PERMISSION_ANONYMOUS ) {
35
+ if ($ resource === AuthorizationService::PERMISSION_ANONYMOUS ) {
36
36
return true ;
37
- } else {
38
- return $ proceed ($ resource , $ privilege );
39
37
}
38
+
39
+ return $ proceed ($ resource , $ privilege );
40
40
}
41
41
}
You can’t perform that action at this time.
0 commit comments