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