'Database Model: How to model the roles an employee can act

I am struggling with this concept in my work DB pet project that handles crews. Each crew member can act in roles (Maintenance Supervisor, Mechanics, Lead Mechanics, Electricians, Automation Leader, etc.). Because crew follows a hierarchy I am interested in build a model where I can save what roles a person can act, for instance: Lead Mechanic can cover absence of a Mechanic, Automation Leader can cover Automation Techs and so on. Each installation has its own training matrix, so it also impact the roles and employees.

One cannot assume Maintenance Supervisor can cover Mechanic position because this person acting as maintenance supervisor came from Automation area and may not act with other disciplines (Electrical, Mechanical, Electronics).

A practical example: Joe is a Mechanic and work in installation A, his main role is a Maintenance Supervisor, because he is a mechanic he can act as Lead Mechanic or Mechanic, but cannot act as any other role in his department, despite being the supervisor of other disciplines. Also because each installation has its own training and competence matrix, Joe is eligible to work in installations A and B but in C.

I have several cases similar to this in various areas, so I realized I have to save these roles a person can act based on their skills. This info is important because when I have to find a cover for a specific role I can check personnel with the same role or supervisors that can fill in as a worst case scenario.

Can someone help me with this conundrum?

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source