Ejemplo n.º 1
0
 /**
  * isAuthorized method
  * Handles the user Authorization inside the controller.
  * @param array $user Authorization component's user
  * @return bool
  */
 public function isAuthorized($user)
 {
     if (isset($this->request->params['pass'][0])) {
         return $this->request->params['pass'][0] == $user['id'];
     }
     // Default deny
     parent::isAuthorized($user);
 }
Ejemplo n.º 2
0
 /**
  * beforeFilter function
  * Allow everyone access the gender list
  *
  * @return void
  */
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->Auth->allow(['index']);
 }