mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-06 23:05:45 -04:00
Deny access to report submodules on which employee doesn't have permissions
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user