For example: a Car is-a Vehicle, i.e. it has all of Vehicle's attributes (e.g. id) and is part of every relationship that Vehicle is part of (e.g. Moves-to), plus new attributes and execlusive relationships of its own.
I want to know this because I am trying to implement a hierarchial user privileges system that looks something like this:
- a Coordinator is-a Member but with more privileges
- a Manager is-a Coordinator but with more privileges
- an Admin is-a Member but with more privileges
Where bold words are entities, and italic words are relationships.
How can I implement this in MySQL? Is there a direct way to do it?
Generally in this database design, each child entity (i.e. Coordinator, Admin and Manager) doesn't offer much new attributes (aside from the ones it inherits from its parent), but each one of them is involved in some execlusive relationships. Should I substitute the Coordinator, Manager and Admin entities with an attribute in the Member table indicating privileges mode (for e.g. members with "mode" value = "admin" are actually admins)? This will cause the Member entity to be involved in ALL the relationships that would otherwise be a child entity execlusive (e.g. Coordinator Coordinates Area will now become Member Coordinates Area). Should I rely on PHP to enforce only Members with certain "mode" value to participate in the otherwise exclusive relationships?
Please Help! I'm desperate