Create new role

I tried create new user row called super admin, and i do the checking on the session/session.php if the login user user_type == 1 or 3 go dashboard without setting icon, 2 go guest .
But i getting error, when i log in as user_type 3 system not allow me to go in the dashboard.

if ($this->session->userdata('user_type') == 1 || ($this->session->userdata('user_type') == 3 ) {
                            redirect('dashboard');
                        } elseif ($this->session->userdata('user_type') == 2) {
                            redirect('guest');
                        }

Can anyone advice me, urgent!!!

It would be helpful if you provide us more informations… like what error are you getting? What file did you changed? Which line? What were your steps you did?

Hi,

The system default setting only 1 and 2 which are admin and guest, i wanted to add one more user role, which is super admin = 3.

On the page top menu, i’ill hide setting icon and all related setting pages, if the user login as super admin, he can use all system module, see the setting icon and access all setting page, if the user login as admin, he only can use the system module.

So the way i did are check the user_type on session.php, if the user login and the type are 1=admin or 3=super admin redirect to dasboard

if ($this->session->userdata('user_type') == 1 || ($this->session->userdata('user_type') == 3 ) {
                            redirect('dashboard');
                        } elseif ($this->session->userdata('user_type') == 2) {
                            redirect('guest');
                        }

and i will check the session user_type on main menu and setting page.

if ( $this->session->userdata(‘user_type’) == 3 ){
show setting icon and setting page
}

sorry for my poor english. hope you understand what i trying to say.

Please what fole did you edit?

User roles should be implemented. As administrator you don’t want regular employees changing system and user settings.
Basically a module that assigns a user id and level that is checked on each built in module so the administrator can give access to employees to items that the administrator assigns. For example you don’t want regular employees to take payments or modify invoices you would uncheck those modules in the user roles that only the administrator can access.

Feature request, for reference: Permissions for Users / User Roles

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.