mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
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:
@@ -21,11 +21,11 @@ class Variable extends APIv1_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct(array('Variable' => 'basis/variable:rw'));
|
||||
// Load model VariableModel
|
||||
$this->load->model('system/variable_model', 'VariableModel');
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,11 +35,11 @@ class Variable extends APIv1_Controller
|
||||
{
|
||||
$uid = $this->get('uid');
|
||||
$name = $this->get('name');
|
||||
|
||||
|
||||
if (isset($uid) && isset($name))
|
||||
{
|
||||
$result = $this->VariableModel->load(array($uid, $name));
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -63,7 +63,7 @@ class Variable extends APIv1_Controller
|
||||
{
|
||||
$result = $this->VariableModel->insert($this->post());
|
||||
}
|
||||
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
@@ -71,9 +71,9 @@ class Variable extends APIv1_Controller
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _validate($variable = NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user