I'm modifying my controller to get the id and send it to the view that has the role, the roles are handled directly from the table default_users
public function sendNew($msg = null)
{
/*funcion para extrar el usuario logeado */
$resu = $this->session->userdata('group_id');
if ($resu == '100') {
$this->template
->build('send');
} else {
$this->template
->build('sendusers');
}
}
in the controller always enters the else, I did it with a query to the database which is the following
mysql_connect("localhost","root","imagina7192");
mysql_select_db("intranet_gana");
$cons = "SELECT * FROM 'default_users' WHERE 'group_id' = 100";
$resu=mysql_query($cons);
$resu = $this->session->userdata('group_id');
if ($resu == '100') {
$this->template
->build('send');
} else {
$this->template
->build('sendusers');
}
The group_id is where the role is handled, where 100 is admin and 1 is a user without permission to see the view
Grace beforehand