Search code examples
umlclass-diagrammulti-user

Is my class diagram for multi user role based app right?


In my case, each user can be attributed one or multiple roles, some roles require extra attributes (for exp "agent maintenance" role hase "spécialité" field). The "Administrateur" role can add/change roles of other users. if my model works fine, is there any better representation? [piece of class diag](https://i.sstatic.net/D9ieA.png)


Solution

  • Your model is fine:

    • multiplicity 1..* tells that a user can have one or more roles
    • each of the role can be an instance of one of the specialisation of the abstract role; each specialisation may therefore have different attributes.

    However, nothing says that Administrator can change roles of others. There are plenty of ways to represent this, for example foresee in Administrator some operations dedicated to the management of the other proles.