Different privileges to different users

hi all

i creating a cms in which i need to give different privileges to different users who will be logging in and updating the content.

a) 3 users should be able to only add content and not able to delete/modify any thing.

b) 3 users should be able to modify/delete anything.

what’s the easy way of doing it.

while showing every result row shall i show the delete/update button with “if statement”.

or can you suggest any other method ?


no suggestions ?

One term you should be searching the web and this forum for is access control - it is usually achieved by setting an access flag in your user table and setting a session variable once a user has logged in.

On each subsequent page request the access control level is checked vs this users level.

Your situation sounds quite simple, some access control systems are complex - try searching simple PHP access control for some initial ideas.

Once your cms has multiple applications you will likely then want to grant different levels depending on who/what level they have.

simple example:

id | name
1 | Bob
2 | Carol
3 | Ted
4 | Alice

id | app
1 | News
2 | Blog

user | app | level
1  -  1  -  1 
1  -  2  -  0
2  -  1  -  0

ie Bob has write access to News but read-only access to Blogs, whereas Carol has read-only rights to News and cannot even access Blog. Ted and Alice cannot access anything at all.

hi cups

thanks for the suggestions