Simple solution makes a use of following tables:
Code:
---------------------------------------------------------
users
---------------------------------------------------------
id | group_id | username | email | password | status ....
---------------------------------------------------------
Code:
----------------------------------------------
groups
----------------------------------------------
id | group_name
----------------------------------------------
Code:
--------------------------------------------------------------------
group_permissions
--------------------------------------------------------------------
id | group_id | page_key | can_edit | can_delete | can_view | can_add
--------------------------------------------------------------------
Note: page_key are the values of the pages where you want to check the permissions.
can_* are the boolean values ie they can have 0 or 1 values.
In PHP you can check like this:
PHP Code:
if (hasPermission($page_key, $action){
//perform action ie can_*
}else{
//redirect to access denied page
}
Hope this helps.
Bookmarks