Added permissions array to every controller that extends APIv1_Controller

CheckUserAuth and Test controllers now extends directly the REST_Controller
This commit is contained in:
Paolo
2018-03-28 12:09:54 +02:00
parent e4a254a284
commit 1fcc878cb5
221 changed files with 1728 additions and 1624 deletions
@@ -21,7 +21,7 @@ class Studentbeispiel extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Studentbeispiel' => 'basis/studentbeispiel:rw'));
// Load model StudentbeispielModel
$this->load->model('education/Studentbeispiel_model', 'StudentbeispielModel');
}
@@ -33,11 +33,11 @@ class Studentbeispiel extends APIv1_Controller
{
$beispiel_id = $this->get('beispiel_id');
$student_uid = $this->get('student_uid');
if (isset($beispiel_id) && isset($student_uid))
{
$result = $this->StudentbeispielModel->load(array($beispiel_id, $student_uid));
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -61,7 +61,7 @@ class Studentbeispiel extends APIv1_Controller
{
$result = $this->StudentbeispielModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -69,9 +69,9 @@ class Studentbeispiel extends APIv1_Controller
$this->response();
}
}
private function _validate($studentbeispiel = NULL)
{
return true;
}
}
}