Example #1
0
 /**
  * Return an array of roles which may be granted the permission based on
  * the options.
  *
  * @param mixed $options Options provided from configuration.
  *
  * @return array
  */
 public function getPermissions($options)
 {
     if ($this->request->getServer()->get('Shib-Identity-Provider') === false) {
         $this->logWarning('getPermissions: Shibboleth server params missing');
         return [];
     }
     return parent::getPermissions($options);
 }
Example #2
0
 /**
  * Setup request and header objects, run getPermissions and check the result
  *
  * @param array $headers        Request headers
  * @param mixed $options        options as from configuration
  * @param array $expectedResult expected result returned by getPermissions
  *
  * @return void
  */
 protected function checkServerParams($headers, $options, $expectedResult)
 {
     $request = new \Zend\Http\PhpEnvironment\Request();
     $request->setServer(new \Zend\Stdlib\Parameters($headers));
     $header = new ServerParam($request);
     $result = $header->getPermissions($options);
     $this->assertEquals($result, $expectedResult);
 }
Example #3
0
 /**
  * Return an array of roles which may be granted the permission based on
  * the options.
  *
  * @param mixed $options Options provided from configuration.
  *
  * @return array
  */
 public function getPermissions($options)
 {
     $this->debug('getPermissions: idpServerParam = ' . $this->idpServerParam);
     if ($this->request->getServer()->get($this->idpServerParam) === null) {
         $this->logWarning('getPermissions: Shibboleth server params missing');
         return [];
     }
     return parent::getPermissions($options);
 }