Deny access to report submodules on which employee doesn't have permissions

This commit is contained in:
jekkos-t520
2014-09-24 08:47:00 +02:00
parent 5cf73130c5
commit 13127c4dc7

View File

@@ -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');
}