column_priv ? restricting user privileges

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
jarow
Forum Commoner
Posts: 83
Joined: Tue Jan 28, 2003 2:58 am

column_priv ? restricting user privileges

Post by jarow »

I have a table with the following columns:

Phylum
Class
Order
Family
Species

Example 1: Let´s say I want to grant limited privileges to a user so he can change anything he wants in the ORDER Coleoptera, i.e., he can change any information in the FAMILY and SPECIES columns that correspond to the ORDER Coleoptera. He cannot change anything in Phylum or Class.

Example 2: I want to grant limited privileges to a user so that he can change anything he wants in the FAMILY mylitidae, i.e. he can change any information in the SPECIES column that corresponds to the FAMILY mylitidae. He, in turn, cannot change anything in Phylum, Class or Order.

That´s the general idea....Does anyone have any idea how I can do this?

Many thanks

Jim
User avatar
AlphaWolf
Forum Newbie
Posts: 12
Joined: Sun Mar 23, 2003 8:49 pm

Post by AlphaWolf »

You could add a user table and then add foreign keys in the other tables pointing to the user table.

Then in your edit pages add if statements to handle the access.

If ORDER = Cleo AND USER = Jim
then edit
else
you don't have access to perform this function.

I assume you all ready have foreign keys built into the other tables tying them together. So when you want a user to change info in the species table you may have:
If SPECIES.id = ORDER.id AND USER = JIM

That might get you something to try any way...
Post Reply