setAuthorizator() public method

Sets authorization handler.
public setAuthorizator ( Nette\Security\IAuthorizator $handler ) : self
$handler Nette\Security\IAuthorizator
return self
コード例 #1
0
ファイル: BasePresenter.php プロジェクト: OCC2/occ2pacs
 /**
  * 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;
 }
コード例 #2
0
 /**
  * @param \Nette\Security\User $user
  */
 public function setup(User $user)
 {
     $user->getStorage()->setNamespace($this->namespace);
     $user->setAuthenticator($this->authenticator);
     $user->setAuthorizator($this->authorizator);
 }