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,11 +21,11 @@ class Aktivitaet extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Aktivitaet' => 'basis/aktivitaet:rw'));
// Load model AktivitaetModel
$this->load->model('project/aktivitaet_model', 'AktivitaetModel');
}
/**
@@ -34,11 +34,11 @@ class Aktivitaet extends APIv1_Controller
public function getAktivitaet()
{
$aktivitaet_kurzbz = $this->get('aktivitaet_kurzbz');
if (isset($aktivitaet_kurzbz))
{
$result = $this->AktivitaetModel->load($aktivitaet_kurzbz);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Aktivitaet extends APIv1_Controller
{
$result = $this->AktivitaetModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Aktivitaet extends APIv1_Controller
$this->response();
}
}
private function _validate($aktivitaet = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Aufwandstyp extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Aufwandstyp' => 'basis/aufwandstyp:rw'));
// Load model AufwandstypModel
$this->load->model('project/aufwandstyp_model', 'AufwandstypModel');
}
/**
@@ -34,11 +34,11 @@ class Aufwandstyp extends APIv1_Controller
public function getAufwandstyp()
{
$aufwandstyp_kurzbz = $this->get('aufwandstyp_kurzbz');
if (isset($aufwandstyp_kurzbz))
{
$result = $this->AufwandstypModel->load($aufwandstyp_kurzbz);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Aufwandstyp extends APIv1_Controller
{
$result = $this->AufwandstypModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Aufwandstyp extends APIv1_Controller
$this->response();
}
}
private function _validate($aufwandstyp = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Projekt extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Projekt' => 'basis/projekt:rw'));
// Load model ProjektModel
$this->load->model('project/projekt_model', 'ProjektModel');
}
/**
@@ -34,11 +34,11 @@ class Projekt extends APIv1_Controller
public function getProjekt()
{
$projekt_kurzbz = $this->get('projekt_kurzbz');
if (isset($projekt_kurzbz))
{
$result = $this->ProjektModel->load($projekt_kurzbz);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Projekt extends APIv1_Controller
{
$result = $this->ProjektModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Projekt extends APIv1_Controller
$this->response();
}
}
private function _validate($projekt = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Projekt_ressource extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Projekt_ressource' => 'basis/projekt_ressource:rw'));
// Load model Projekt_ressourceModel
$this->load->model('project/projekt_ressource_model', 'Projekt_ressourceModel');
}
/**
@@ -34,11 +34,11 @@ class Projekt_ressource extends APIv1_Controller
public function getProjekt_ressource()
{
$projekt_ressourceID = $this->get('projekt_ressource_id');
if (isset($projekt_ressourceID))
{
$result = $this->Projekt_ressourceModel->load($projekt_ressourceID);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Projekt_ressource extends APIv1_Controller
{
$result = $this->Projekt_ressourceModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Projekt_ressource extends APIv1_Controller
$this->response();
}
}
private function _validate($projekt_ressource = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Projektphase extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Projektphase' => 'basis/projektphase:rw'));
// Load model ProjektphaseModel
$this->load->model('project/projektphase_model', 'ProjektphaseModel');
}
/**
@@ -34,11 +34,11 @@ class Projektphase extends APIv1_Controller
public function getProjektphase()
{
$projektphaseID = $this->get('projektphase_id');
if (isset($projektphaseID))
{
$result = $this->ProjektphaseModel->load($projektphaseID);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Projektphase extends APIv1_Controller
{
$result = $this->ProjektphaseModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Projektphase extends APIv1_Controller
$this->response();
}
}
private function _validate($projektphase = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Projekttask extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Projekttask' => 'basis/projekttask:rw'));
// Load model ProjekttaskModel
$this->load->model('project/projekttask_model', 'ProjekttaskModel');
}
/**
@@ -34,11 +34,11 @@ class Projekttask extends APIv1_Controller
public function getProjekttask()
{
$projekttaskID = $this->get('projekttask_id');
if (isset($projekttaskID))
{
$result = $this->ProjekttaskModel->load($projekttaskID);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Projekttask extends APIv1_Controller
{
$result = $this->ProjekttaskModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Projekttask extends APIv1_Controller
$this->response();
}
}
private function _validate($projekttask = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Ressource extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Ressource' => 'basis/ressource:rw'));
// Load model RessourceModel
$this->load->model('project/ressource_model', 'RessourceModel');
}
/**
@@ -34,11 +34,11 @@ class Ressource extends APIv1_Controller
public function getRessource()
{
$ressourceID = $this->get('ressource_id');
if (isset($ressourceID))
{
$result = $this->RessourceModel->load($ressourceID);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Ressource extends APIv1_Controller
{
$result = $this->RessourceModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Ressource extends APIv1_Controller
$this->response();
}
}
private function _validate($ressource = NULL)
{
return true;
}
}
}
@@ -21,11 +21,11 @@ class Scrumsprint extends APIv1_Controller
*/
public function __construct()
{
parent::__construct();
parent::__construct(array('Scrumsprint' => 'basis/scrumsprint:rw'));
// Load model ScrumsprintModel
$this->load->model('project/scrumsprint_model', 'ScrumsprintModel');
}
/**
@@ -34,11 +34,11 @@ class Scrumsprint extends APIv1_Controller
public function getScrumsprint()
{
$scrumsprintID = $this->get('scrumsprint_id');
if (isset($scrumsprintID))
{
$result = $this->ScrumsprintModel->load($scrumsprintID);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -62,7 +62,7 @@ class Scrumsprint extends APIv1_Controller
{
$result = $this->ScrumsprintModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -70,9 +70,9 @@ class Scrumsprint extends APIv1_Controller
$this->response();
}
}
private function _validate($scrumsprint = NULL)
{
return true;
}
}
}