Multiple user database design

Posted by dieguitoweb on Stack Overflow See other posts from Stack Overflow or by dieguitoweb
Published on 2011-02-07T15:21:48Z Indexed on 2011/02/07 15:25 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

I have to develop a basic social network for an academic purpose; but I need some tips for the users management..

The users are subdivided into 3 groups with different privilege: admins,analysts and standards users. For every user should be stored into the database the following information: name,lastname,e-mail,age,password.

I'm not quite sure how I should design the database between theese two solutions:

1)one table called 'users' with the 'role' attribute that explain what a user can do and what can't do, and the permissions are managed via php

2)every application user is a database user created with the query 'CREATE ROLE' (It's a postgres database) and he has permissions on some tables granted with the 'GRANT' statement

You should take into account that the project is for a database exam..

thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about sql