示例#1
0
文件: Configs.php 项目: scalr/scalr
 /**
  * @param WebhookConfig $webhook
  * @return bool
  * @throws Exception
  */
 private function canManageWebhook($webhook)
 {
     return $this->request->getScope() == $webhook->getScope() && ($webhook->getScope() == WebhookConfig::SCOPE_SCALR || $webhook->getScope() == WebhookConfig::SCOPE_ACCOUNT && $webhook->accountId == $this->user->getAccountId() && $this->request->isAllowed(Acl::RESOURCE_WEBHOOKS_ACCOUNT, Acl::PERM_WEBHOOKS_ACCOUNT_MANAGE) || $webhook->getScope() == WebhookConfig::SCOPE_ENVIRONMENT && $webhook->envId == $this->getEnvironmentId() && $webhook->accountId == $this->user->getAccountId() && $this->request->isAllowed(Acl::RESOURCE_WEBHOOKS_ENVIRONMENT, Acl::PERM_WEBHOOKS_ENVIRONMENT_MANAGE));
 }
示例#2
0
 /**
  * @param WebhookConfig $webhook
  * @throws Exception
  */
 private function canEditWebhook($webhook)
 {
     return $this->request->getScope() == $webhook->getScope() && ($webhook->getScope() == WebhookConfig::SCOPE_SCALR || $webhook->getScope() == WebhookConfig::SCOPE_ACCOUNT && $webhook->accountId == $this->user->getAccountId() || $webhook->getScope() == WebhookConfig::SCOPE_ENVIRONMENT && $webhook->envId == $this->getEnvironmentId() && $webhook->accountId == $this->user->getAccountId());
 }