Nette\Security\User::setAuthorizator PHP Method

setAuthorizator() public method

Sets authorization handler.
public setAuthorizator ( Nette\Security\IAuthorizator $handler ) : self
$handler Nette\Security\IAuthorizator
return self
    public function setAuthorizator(IAuthorizator $handler)
    {
        $this->authorizator = $handler;
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Startup method
  * @return void
  */
 public function startup()
 {
     parent::startup();
     $this->lang = $this->translator->setLanguage($this->lang);
     $this->answers[0] = _("No");
     $this->answers[1] = _("Yes");
     // load user to presenter
     $this->user = $this->getUser();
     // zkusi jestli je uzivatel prihlasen
     if (!$this->user->isLoggedIn()) {
         $this->redirect(":User:Authenticator:default", array('backlink' => $this->storeRequest()));
     }
     $this->lang = $this->user->getIdentity()->getData()["lang"];
     $this->user->setAuthorizator(new \UserModule\Authorizator());
     return;
 }
All Usage Examples Of Nette\Security\User::setAuthorizator