Niveles de acceso de usuarios en codignetor

I'm creating project using codignetor 2.0.2. I have four types of users and each can access a different set of pages. How can I do this in codignetor ?

I have users as -

  1. Super administrador : can access all pages

  2. Administración : can access only a admin section of site and don't have access to user's section

  3. Usuario : can access reports only

  4. Visitante : limited access to reports

preguntado el 08 de noviembre de 11 a las 11:11

2 Respuestas

Check some authorization libraries with some basic priviliges. You will have then database structure and some examples. For example Tank auth.

Most of the time after user log in you adding to session his group_id and in controllers you check if that group can access that page.

como:

if($this->session->userdata('group_id')!=1){
   $this->session->set_flashdata('error','Permission denied');
   redirect('/');
}else{
   //show page
}

respondido 08 nov., 11:15

As far as I know Tank Auth doesn't handle level acces for users... at least the version being the last one 2 months ago (can't check which one right now) but with some modifications you can work it out. - Luso

There are libraries already. You can use that..

DX_Auth

Redux_Auth

Tank_Auth

respondido 08 nov., 11:15

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.