/** * 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())); } } }
/** * 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)); } }
/** * 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()); } } }
/** * 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())); } } }
/** * 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())); } }