Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help creating organisational "chart" in MySQL

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
0
0
IE
I have a db with an employees table which contains each user, a groups table which contains the groups, and a usersingroups table which tracks what groups an employee is a member of. however, what I need to implement (possibly by setting up different "grade" groups) an organisational structure for approval. Reason being that, say I have a data entry department with 2 teams, each managed by a separate supervisor. Each supervisor should be able to approve and modify reports etc only for their own staf. However, the supervisors manager should be able to do the same for both teams (because they're one grade higher). So basically people need to be able to approve, modify etc for people at a lower level than them provided they're in the same team. Can somebody help me out on how to put this in the db. do i need to create another table or ... ?
 
why don't you try adding a second table and a new field in your Users table. The new field should be an ID number corresponding to the auto_id in the new table. The new table should just be a list of yes or no answers to permission questions: example table setup
MemberPermissionsTable
auto_id
name - varchar(30) //name of user type i.e. user, supervisor, admin, etc.
create_projects - enum('0','1') //no or yes, respectively
modify_projects - enum('0','1')
approve_projects - enum('0','1')
ranking - smallint UNIQUE
...more permissions...

and the ranking should correspond to its appropriate place in the heirarchy.

In the implementation of this, just use variables like ranking+1 to determine who should approve projects and so forth...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top