getGuestRole() public method

Get the guest role (used when no identity is found)
public getGuestRole ( ) : string
return string
コード例 #1
0
 public function testSettersAndGetters()
 {
     $moduleOptions = new ModuleOptions(['identity_provider' => 'IdentityProvider', 'guest_role' => 'unknown', 'guards' => [], 'protection_policy' => 'deny', 'role_provider' => [], 'assertion_map' => ['foo' => 'bar'], 'unauthorized_strategy' => ['template' => 'error/unauthorized'], 'redirect_strategy' => ['redirect_to_route_connected' => 'home', 'redirect_to_route_disconnected' => 'login']]);
     $this->assertEquals('IdentityProvider', $moduleOptions->getIdentityProvider());
     $this->assertEquals('unknown', $moduleOptions->getGuestRole());
     $this->assertEquals([], $moduleOptions->getGuards());
     $this->assertEquals('deny', $moduleOptions->getProtectionPolicy());
     $this->assertEquals([], $moduleOptions->getRoleProvider());
     $this->assertEquals(['foo' => 'bar'], $moduleOptions->getAssertionMap());
     $this->assertInstanceOf('ZfcRbac\\Options\\UnauthorizedStrategyOptions', $moduleOptions->getUnauthorizedStrategy());
     $this->assertInstanceOf('ZfcRbac\\Options\\RedirectStrategyOptions', $moduleOptions->getRedirectStrategy());
 }
コード例 #2
0
ファイル: RbacCollector.php プロジェクト: htw-pk15/vufind
 /**
  * Collect options
  *
  * @param  ModuleOptions $moduleOptions
  * @return void
  */
 private function collectOptions(ModuleOptions $moduleOptions)
 {
     $this->collectedOptions = ['guest_role' => $moduleOptions->getGuestRole(), 'protection_policy' => $moduleOptions->getProtectionPolicy()];
 }