mercredi 16 novembre 2016

How can i define roles and stored in mongoDB database for the following structure in php

I have following hierarchy but not getting how can I manage structure to store this for users.

Roles are:

'Chief', 'Head', 'Promotions_Zonal_Head', 'Promoter', 'Faculty', 'Participant'

Departments:

ADMIN, ACCOMMODATION, TECHNICAL, PROMOTIONS, DECORATION, SPONSORSHIP

Sub-Departments:

Technical has sub-department as 'XYZ', 'PQR'

XYZ has head and further X has Head, Y has Head, Z has Head.

Structure That I have thought:

For Technical Head:

{
     'email' : 'adsa@gmail.com',
     'password' : 'some random',
     'role' : 'head',
     'department' : 'technical',
}

But how to differentiate this with the following?

FOR XYZ Head:

{
     'email' : 'adsa@gmail.com',
     'password' : 'some random',
     'role' : 'head',
     'department' : 'Technical',
     'group' : 'XYZ'
}

Any suggestion for the structure?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire