Example #1
0
 /**
  * @param Event $event
  * @param array $options
  *
  * @return bool
  */
 private function checkPermissions(Event $event, array $options)
 {
     $securityCode = $options['securityCode'];
     $author = $options['allowedAuthors'];
     $host = $options['allowedHosts'];
     if ($securityCode && $securityCode != $event->getSecurityCode()) {
         $this->logger->warning('Security code not match');
         $this->logger->debug('Config: ' . $securityCode . ' != $_GET:' . $event->getSecurityCode());
         return false;
     }
     if (!$this->checkAllow($host, $event->getHost())) {
         $this->logger->warning('Host ' . $event->getHost() . ' not allowed on this branch');
         return false;
     }
     if (!$this->checkAllow($author, $event->getAuthor())) {
         $this->logger->warning('Author ' . $event->getAuthor() . ' not allowed on this branch');
         return false;
     }
     return true;
 }