Exemplo n.º 1
0
 protected function validate($action, $foreignModel, $foreignKey, array $data = array())
 {
     $result = parent::validate($action, $foreignModel, $foreignKey, $data);
     if ($data[$this->context]['type'] != 'user') {
         $result = false;
     }
     return $result;
 }
Exemplo n.º 2
0
 public function add($action, $foreignModel, $foreignKey, array $data = array())
 {
     $result = parent::validate($action, $foreignModel, $foreignKey, $data);
     if (!$data[$this->context]['published']) {
         $result = false;
     }
     return $result;
 }
Exemplo n.º 3
0
 protected function addComment($action, $foreignModel, $foreignKey, array $data = array())
 {
     $result = parent::validate($action, $foreignModel, $foreignKey, $data);
     $projectEventModel = ClassRegistry::init('ProjectEvent');
     if ($data[$this->context]['event_type'] != $projectEventModel::TASK_COMMENT) {
         $result = false;
     }
     return $result;
 }
Exemplo n.º 4
0
 public function requestTo($action, $foreignModel, $foreignKey, array $data = array())
 {
     $result = parent::validate($action, $foreignModel, $foreignKey, $data);
     if ($result && $data[$this->context]['approved'] == true) {
         $result = true;
     } else {
         $result = false;
     }
     return $result;
 }
Exemplo n.º 5
0
 protected function close($action, $foreignModel, $foreignKey, array $data = array())
 {
     $result = parent::validate($action, $foreignModel, $foreignKey, $data);
     if ($result && !empty($data[$this->context]['closed'])) {
         $result = true;
     } elseif ($result && empty($data[$this->context]['closed'])) {
         $result = false;
     }
     return $result;
 }