Create new user type in gocart

first go to views -> admin -> admin_forms.php file.

go to near this lines: ‘Admin’, ‘Orders’ => ‘Orders’, ‘Software_op’=>’Software Operator’ );

echo form_dropdown(‘access’, $options, set_value(‘phone’, $access)); ?>

* after adding your user like mine, i have added software operator. you will see in this list in your admin panel.

—————————————————————————–

Now you have do some Auth works in your header.php file and those pages you want to restrict.

like here my software operator will see only catalog’s categories and products pages in their admin panel.

in dashboard.php file comment these below lines:

// if($this->auth->check_access(‘Orders’)){

// redirect($this->config->item(‘admin_folder’).’/orders’);

// }

Now go to categories.php controller file and add these lines:

$this->CI =& get_instance();

$admin = $this->CI->session->userdata(‘admin’);

$access=$admin[‘access’];

//$this->auth->check_access(‘Admin’, true);

$this->auth->check_access($access, true);

*** note: you must comment this line on your controller file:

//$this->auth->check_access(‘Admin’, true);

You are done!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>