you might want to create a table called perms and have each row contain a
user id and a perm for each

the way i have mine setup is a bit more complex but fully configurable.
Here's how i would set it up

- user_id
- action
- value

- id
- title

- id
- username
- passwd

then to get the permissions i would use a user object maybe something like

class user {
var $_id;
var $_permissions;

function user() {

function hasPermission($val) {
$perm = $this->getPermission($val);
if(isset($perm) && $perm == 1) return true;
else return false

function loadPermissions() {
global $db;
$res = $db->Query("SELECT user_permissions.value, user_actions.title value
FROM user_permissions INNER JOIN user_actions ON"
$data = $db->fetchAll($res);
return $data

Understand that this code will not work out of the box and no security
measures were implemented, i did this just to show an example ;)

In my system i have user permissions and group permissions, i load the group
permissions then override with the user permissions.

Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.

Reply via email to