[eluser]malzahar[/eluser]
I'm building an application which will have three different roles and was wondering what would make the most sense in database design and then logic when creating authentication.
If all three groups (admin, editors, users) need the following:
fname, lname, email, password, etc.
but the users group also needs:
field1, field2, field3, field4, etc.
Would it make sense to have a single table containing all three groups and a roles field leaving the user fields empty for admin and editors or three separate tables where I'm repeating the same fields in each table?
Once this is done and I write the authentication part does it make sense to do something like
Code:
$role = $this->session->data('role');
if ($role == 'user') {
$this->load->view("admin_area");
}
else if ($role == 'admin') {
$this->load->view("user_area");
}
}
or to have completely different log in areas.
What are the best practices for handling different user groups?