Search code examples
classpermissionsumldiagramoop

How to best visualize a "permission Matrix" in an UML class diagram?


For the sake of simplicity:

There is a permission based system in place with different kinds of user levels and actions (think: UNIX file system permissions)

What would be the best approach to visualize this in UML?


Solution

  • I typically have classes that represent Users, Roles, and Permissions. Users belong to Roles and Roles are granted Permissions. Permissions are required to access other objects. In UML I suppose that you would model Role as an abstract base class and have multiple different implementations, one for each role.

    Typically, I model a Permission as object containing sets of readable,writable,delete-able business entity classes (perhaps containing property exclusions or inclusions). Each role, then has one Permission. That permission allows or denies access to one or more other classes. Permission is by default denied, and access only allowed if the class is in the appropriate set for the action requested.