Consider the well known example data-model that contains courses and instructors. A course has one instructor has many courses. Suppose now we want to base this model on the ASP.NET Identity model which has users and roles. A straightforward way would be to let instructors inherit from an ASP.NET Identity user. However, let's say we want the janitor of the school to also be a user of the system. Moreover, nothing prevents an instructor from being a janitor in the afternoon.
There's no multiple inheritance, so you cannot be, say, an InstructorUser and a JanitorUser. A user has only courses if his role is that of an instructor, so it is IMO not a clean approach to have every user have a relationship to courses (he might not be an instructor after all). I'm considering to create a separate instance of InstructorRole
(inheriting from IdentityRole
) for each an every user, if he is an instructor.
I see that simple examples have a low number of generic roles, such as "admin" or "guest". Is it a bad practice to have at least one separate role for each user?