Exemplo n.º 1
0
 /**
  * isAUtorized method
  *
  * @return void
  */
 public function isAuthorized($user)
 {
     if ($this->request->action === 'index' && $this->Requeststatus->indexAuthorized($user)) {
         return true;
     } elseif ($this->request->action === 'changeStatus') {
         return true;
     } else {
         parent::isAuthorized($user);
     }
 }
Exemplo n.º 2
0
 /**
  * isAUtorized method
  *
  * @return void
  */
 public function isAuthorized($user)
 {
     $requestId = isset($this->request->params['request_id']) ? $this->request->params['request_id'] : 0;
     $this->Auth->config('unauthorizedRedirect', false);
     if ($this->request->action === 'index' && $this->Requesthistorics->Requests->viewAuthorized($user, $requestId)) {
         return true;
     } elseif ($this->Requesthistorics->Requests->adminAuthorized($user)) {
         return true;
     } else {
         parent::isAuthorized($user);
     }
 }
Exemplo n.º 3
0
 /**
  * isAUtorized method
  *
  * @return void
  */
 public function isAuthorized($user)
 {
     $this->Auth->config('unauthorizedRedirect', false);
     $params = $this->request->params;
     if ($this->request->action === 'view' && $this->Requests->viewAuthorized($user, $this->request->id)) {
         return true;
     } elseif ($this->request->action === 'add' && $this->Requests->addAuthorized($user, $this->request->id)) {
         return true;
     } elseif ($this->request->action === 'index' && $this->Requests->indexAuthorized($user, $params)) {
         return true;
     } elseif ($this->Requests->adminAuthorized($user) && $this->request->action !== 'accept' && $this->request->action !== 'reject' && $this->request->action !== 'add') {
         return true;
     } elseif ($this->request->action === 'delete' || $this->request->action === 'index') {
         return false;
     } elseif ($this->request->action === 'cancel' && $this->Requests->viewAuthorized($user, $params['pass'][0])) {
         return true;
     } elseif (($this->request->action === 'accept' || $this->request->action === 'reject') && isset($user[$this->Requests->getFieldTarget()]) && $this->Requests->viewAuthorized($user, $params['pass'][0])) {
         return true;
     } else {
         parent::isAuthorized($user);
     }
 }