コード例 #1
0
ファイル: Integration.php プロジェクト: Doability/magento2dev
 /**
  * Add the list of allowed resources to the integration object data by 'resource' key.
  *
  * @param IntegrationModel $integration
  * @return void
  */
 protected function _addAllowedResources(IntegrationModel $integration)
 {
     $integrations = array_merge($this->integrationConfig->getIntegrations(), $this->consolidatedConfig->getIntegrations());
     if ($integration->getId()) {
         if ($integration->getSetupType() == IntegrationModel::TYPE_CONFIG) {
             $integration->setData('resource', $integrations[$integration->getData('name')]['resource']);
         } else {
             $integration->setData('resource', $this->aclRetriever->getAllowedResourcesByUser(UserContextInterface::USER_TYPE_INTEGRATION, (int) $integration->getId()));
         }
     }
 }
コード例 #2
0
 /**
  * Add the list of allowed resources to the integration object data by 'resource' key.
  *
  * @param IntegrationModel $integration
  * @return void
  */
 protected function _addAllowedResources(IntegrationModel $integration)
 {
     if ($integration->getId()) {
         $userIdentifier = $this->_createUserIdentifier($integration->getId());
         $integration->setData('resource', $this->_authzService->getAllowedResources($userIdentifier));
     }
 }
コード例 #3
0
 /**
  * Add oAuth token and token secret.
  *
  * @param IntegrationModel $integration
  * @return void
  */
 protected function _addOauthTokenData(IntegrationModel $integration)
 {
     if ($integration->getId()) {
         $accessToken = $this->_oauthService->getAccessToken($integration->getConsumerId());
         if ($accessToken) {
             $integration->setData('token', $accessToken->getToken());
             $integration->setData('token_secret', $accessToken->getSecret());
         }
     }
 }
コード例 #4
0
ファイル: Integration.php プロジェクト: rahulkumars/magento2
 /**
  * Add the list of allowed resources to the integration object data by 'resource' key.
  *
  * @param IntegrationModel $integration
  * @return void
  */
 protected function _addAllowedResources(IntegrationModel $integration)
 {
     if ($integration->getId()) {
         if ($integration->getSetupType() == IntegrationModel::TYPE_CONFIG) {
             $integration->setData('resource', $this->getIntegrationApiResource($integration));
         } else {
             $integration->setData('resource', $this->aclRetriever->getAllowedResourcesByUser(UserContextInterface::USER_TYPE_INTEGRATION, (int) $integration->getId()));
         }
     }
 }
コード例 #5
0
 /**
  * Add the list of allowed resources to the integration object data by 'resource' key.
  *
  * @param IntegrationModel $integration
  * @return void
  */
 protected function _addAllowedResources(IntegrationModel $integration)
 {
     if ($integration->getId()) {
         $integration->setData('resource', $this->aclRetriever->getAllowedResourcesByUser(UserContextInterface::USER_TYPE_INTEGRATION, (int) $integration->getId()));
     }
 }