Closed rebirthtobi closed 7 years ago
i just fix it now but it might help anybody, it appears that the controller saved in the database starts with a Capital letter and but the User_access_map.php quries in small letter. i change the User_access_map.php to this below for it to work
function set_permission($controller,$role,$permission){
$data['user_role_id']=$role;
$data['controller']=strtolower($controller);
$data['permission']=$permission;
$where=array('user_role_id'=>$role,'controller'=>$controller);
$query = $this->db->get_where($this->_table_name, $where, 1, 0);
if ($query->num_rows() == 0) { //Insert
$this->db->insert($this->_table_name, $data);
return;
}
//Existing data so update
$this->db->update($this->_table_name, $data,$where);
}
i have to add strtolower for it to work but i still need to know how more roles apart from the database
You can add more role in db. If you are referring to view, edit .. you can add in default_access_map config
Thanks
After defining my access_map in the controller, using the code
it only allows me to access the index and block out all other methods and also how can i add more roles