Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make session to allow different project?

I am planning to make a project management with PHP/MySQL/Codeigniter.

It will have 10 - 20 users and 20 - 30 projects going on at the same time.

Let's say John is a member of project A, B and C. Cindy is in A, D, F G etc.

I want to make it only members of project can access the project.

Now I am not sure how to approach this.

What do you suggest in terms of DB-design and session.

Any resources will be appreciated.

like image 334
shin Avatar asked Feb 28 '23 02:02

shin


1 Answers

If you don't want to use a framework solution:

  1. Have User, Project, and UserProject tables.

  2. For every project a user is on, the UserProject table will have the UserID and the Project ID in a row.

  3. When creating the session, you can pull from the UserProject table to find what projects are allowable (and for example, put them in an array that can be searched when navigation is shown).

  4. Additionally, Each project could have a user set as admin that can add other users.

like image 179
Cryophallion Avatar answered Mar 05 '23 16:03

Cryophallion