sql - How to manage user and group using DB and PHP? -



The software for our internal team is the web site for the repository.
Currently, many users are divided into different groups.
To manage them, we are using string like '000101', and check '1 000101 and depending on it, we decide which group is


'01111' => group 'test1'
'10111' => group 'test2'
'11011' => group 'axa1' '11101' => Group 'Axa 2'
'11110' => Group 'Administrators'
We do 'and' operations with user access with group ...
Users = 'Any', Access = '01001' ... means that the user (a) group => Test 2 and comes under the administrator.

We store this binary number. String for DB
Now the situation is like an increase in the number of groups (60+) and I'm looking for some new logic instead of binary string to identify user and related groups.













Post-text "itemprop =" text "> creating tables group_mail (group_id INTEGER NOT NULL, member_id INTEGER not void, primary key (member_id, group_id));

In the original SQL clusters, there is a member table, a group table and a table mapping member. It is called an many-to-many relationships .

By coincidence, the number you show does not mean ... if you want 60 groups, then you want 60-bit-long numbers, as long as some groups do something Others do not have supersets to set up group membership, this will be one or the operation, and no more.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -