Ejemplo n.º 1
0
 public function addRole($role_array)
 {
     $role_model = new RoleModel();
     $legit = $this->validateRoleArray($role_array);
     //die(var_dump($legit[P_STATUS] == STATUS_OK));
     if ($legit[P_STATUS] == STATUS_OK) {
         $response = array();
         $feedback = $role_model->add($role_array);
         if ($feedback) {
             $response[P_STATUS] = STATUS_OK;
         } else {
             $response[P_STATUS] = STATUS_ERROR;
             $response[P_MESSAGE] = "Unable to add role!";
         }
         return $response;
     } else {
         return $legit;
     }
 }