Welcome Guest, Not a member yet? Register   Sign In
Call model not work
#4

I use acl for restriction over hook:

class ACL {
private $perms;
private $role_field;
private $CI;
public function __construct() {
$this->CI =&get_instance();
if (!isset($this->CI->session))
{ # Sessions are not loaded
$this->CI->load->library('session');
}
if (!isset($this->CI->router))
{ # Router is not loaded
$this->CI->load->library('router');
}
if (!isset($this->CI->url))
{ # Router is not loaded
$this->CI->load->helper('url');
}
$this->CI->load->model('permisos_model');
//$this->CI->load->model('recursos_model'); <- work if enable here

if($this->CI->session->userdata('rolID')){
$this->role_field = $this->CI->session->userdata('rolID');
} else
$this->role_field = 0;
$hola = $this->CI->permisos_model->getAllow();
foreach ($hola->result_array() as $key => $value) {
$this->perms[$value['rolID']][$value['controller']][$value['metod']] = ($value['status'] == 1) ? TRUE : FALSE;
}
}

But it is no longer necessary to state in the controller constructor, what problems or what would help or hurt this situation?
Reply


Messages In This Thread
Call model not work - by Wilmer - 01-03-2017, 09:46 AM
RE: Call model not work - by albertleao - 01-03-2017, 11:17 AM
RE: Call model not work - by Wilmer - 01-03-2017, 05:32 PM
RE: Call model not work - by Wilmer - 01-03-2017, 06:29 PM
RE: Call model not work - by albertleao - 01-04-2017, 09:53 PM
RE: Call model not work - by Wilmer - 01-05-2017, 05:50 AM
RE: Call model not work - by ProfessionalCoder - 02-21-2017, 09:28 AM
RE: Call model not work - by ignitedcms - 02-23-2017, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB