Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Authorization Class Reference
Inheritance diagram for Authorization:
AuthorizationMock

Public Member Functions

 __construct (\Magento\Framework\AuthorizationInterface $authorization)
 
 isAllowed ($aclResources)
 

Protected Attributes

 $authorization
 

Detailed Description

Web API authorization model.

@api

Since
100.1.0

Definition at line 14 of file Authorization.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\AuthorizationInterface  $authorization)

Initialize dependencies.

Parameters
\Magento\Framework\AuthorizationInterface$authorization

Definition at line 27 of file Authorization.php.

28  {
29  $this->authorization = $authorization;
30  }

Member Function Documentation

◆ isAllowed()

isAllowed (   $aclResources)

Check if all ACL resources are allowed to be accessed by current API user.

Parameters
string[]$aclResources
Returns
bool
Since
100.1.0

Definition at line 39 of file Authorization.php.

40  {
41  foreach ($aclResources as $resource) {
42  if (!$this->authorization->isAllowed($resource)) {
43  return false;
44  }
45  }
46  return true;
47  }
$resource
Definition: bulk.php:12

Field Documentation

◆ $authorization

$authorization
protected

Definition at line 20 of file Authorization.php.


The documentation for this class was generated from the following file: