Exemple #1
0
 private function checkAuthorization()
 {
     $presenter = String::lower($this->getReflection()->getName());
     $user = Environment::getUser();
     $user->setAuthorizationHandler(MokujiServiceLocator::getService('UserAuthorizator'));
     //if(Environment::getServiceLocator()->hasService('UserAuthorizator')) $user->setAuthorizationHandler(Environment::getService('UserAuthorizator'));
     //else $user->setAuthorizationHandler(new Admin_UserModel());
     if ($this->formatActionMethod($this->action) == 'actiondeny') {
         return;
     }
     if ($user->isAllowed($presenter, $this->formatActionMethod($this->action)) === true) {
         if ($user->isAllowed($presenter, $this->formatSignalMethod($this->signal)) === false) {
             throw new AuthenticationException('This action is not allowed');
         }
     } else {
         throw new AuthenticationException('This action is not allowed');
     }
 }