diff --git a/application/controllers/reports.php b/application/controllers/reports.php index 6d949d46a..a85c8a1c9 100644 --- a/application/controllers/reports.php +++ b/application/controllers/reports.php @@ -10,6 +10,15 @@ class Reports extends Secure_area function __construct() { parent::__construct('reports'); + $method_name = $this->uri->segment(2); + $exploder = explode('_', $method_name); + $submodule_id = $exploder[sizeof($exploder)-1]; + $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; + // check access to report submodule + if (sizeof($exploder) > 1 && !$this->Employee->has_permission('reports_'.$submodule_id,$employee_id)) + { + redirect('no_access/'.$submodule_id); + } $this->load->helper('report'); }