User groups

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
visionmaster
Forum Contributor
Posts: 139
Joined: Wed Jul 14, 2004 4:06 am

User groups

Post by visionmaster »

Hello,

We're planning to programm a webinterface (backoffice) for call agents. What is the best or lets say most practical solution for solving the user rights problem? E.g. users of a group 1 are allowed to write, read, etc., users of another group have restricted rights.

Should I just have one field in my database like "dbGroup". A user that logs in belongs to a specific group. This field holds a string like 'admin', 'secretary', 'call agent'. I can then just read the content of this field, giving me info to which group the user belongs.

Is that all or is that to simple? Another solution from those database professionells out there?

Regards,
Rania
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

A field you call it lie you want (example : rights)
and you set a right for the groups, if the right is 1 they can access this information etc...

in other word you just retreive the value of the field and in php you do a little if
and you display whatever you want depending on the value stored.
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

We have similar such things on our Intranet. For flexibility there are several tables such as:

Applications
AppId
AppName

Groups
GroupID
GroupName

AppGroupXref
AppId
GroupID
AccessLevel

Users
UserId
UserName

UserGroupXref
UserId
GroupID

and I think there is more - basic idea is users can belong to multiple groups that have differering access rights to different applications.
Perhaps Call Agents have full access to applications most pertinant to their
job, read-only access to other apps. The XYZ department has read-only access to the Call Agent apps, etc. But the call agent manager has more rights to more apps than the agents....that sort of thing. The more open-ended you can make it, the better - you can use for all sorts of things.

fv
Post Reply