How to Model Permissions on Use Case for Actors

In use case diagram, associations between actors and use cases are explicitly shown. We can see it clearly when an actor carries out a use case (or goal) from a line drawn between them. However, what if an actor does not carry out a use case but do refer to the output from it? How do we model that?

For example, the manager reorders stock but he/she may refer to orders placed by customers (while he/she does not actually carry out the order placing).

An example of a use case diagram

An example of a use case diagram

In this tutorial, we will show you one way to model relationships that are not so explicit. We will make use of chart diagram to create a matrix to store the permissions.

First, in a new chart diagram, we’ll create a new code type called Permission and 3 possible values under it – Read, Write and Execute. Then, we’ll create a matrix to list all combinations of actors and use cases (i.e. associations). In cells where appropriate, we use one of the 3 values to describe their associations. For example, if an actor actually carries out a use case, we give it the value, Execute. If an actor refers to output from a use case, we describe the relationship by the value, Read.

Note: The following example is shown using Visual Paradigm for UML (VP-UML) Professional edition.

Steps to Model Permissions

  1. Define your own permissions code

    Go to the toolbar on the top. Click on Diagrams > Chart Diagram.

    Create a new chart diagram from toolbar

    Create a new chart diagram from toolbar

    In the new chart diagram, locate the Code Type field and click the button to the right.

    Click button to configure code types

    Click button to configure code types

    In the dialog box opened, (at the lower left corner) click Add and then select Code Type.

    select to begin creating a new code type

    select to begin creating a new code type

    Enter Permission for code type.

    Name the new code type Permission

    Name the new code type Permission

    Next, we’ll add 3 new codes under the Permission code type that we’ve just created.
    To add a new code, click Add and select Code.

    Click to add a new code under Permission

    Click to add a new code under Permission

    Enter Read for Name. Then enter R for Code.

    Enter the 1st new code

    Enter the 1st new code

    To add the second new code, just click Add and select Code again.
    You’ll notice that the Read code we’ve just created shows up in the list and that to the right, it is ready for you to enter another new code.

    1st new code shows up in the list

    1st new code shows up in the list

    Repeat to enter the following 2 codes.
    Name = Write; Code = W
    Name = Execute; Code = E
    After you enter the Execute code, click OK.

    Enter the third new code

    Enter the third new code

    Note: Clicking OK will close the dialog box above. But if you want to look at your new list of codes, you can always click the button to open it again.

    Check your new list of codes

    Check your new list of codes

  2. Set up a permissions matrix

    In this section, we’ll set up a matrix to display all combinations of actors and use cases.
    To specify the matrix row, select Actor and then click the top green right arrow.

    Select Actor for row in matrix

    Select Actor for row in matrix

    To specify the matrix column, select Use Case and then click the lower green right arrow.

    Select Use Case for column in matrix

    Select Use Case for column in matrix

    Remember the Permission code type we added earlier? This is where we’ll put it into use.
    To specify possible values that can go into the individual cells of the matrix, go to the Code Type field.
    Click the down arrow to the right and select Permission.

    Select the code type for possible values in matrix's cells

    Select the code type for possible values in matrix’s cells

    Click OK.

    Click OK to generate matrix

    Click OK to generate matrix

  3. Set permissions for individual actors on various use cases

    In the matrix opened, you’ll see the 4 actors in rows and the 5 use cases in columns. Each cell in the matrix represents a combination of an actor and a use case. In it, that’s where we are going to specify the corresponding permissions (Read, Write or Execute).

    A fresh matrix

    A fresh matrix

    A lot of times, we’d probably begin with the first row and column. But here, we’ll look at another combination first, just so we can address the manager’s case which is mentioned in the beginning of this tutorial. Then we’ll look at the other cases.

    To model that the manager is authorized to reorder stock
    Right click on the cell that intersects Manager and Reorder stock. Select E: Execute from the list. E should appear in that cell.

    Model Execute permission on Reorder Stock for Manager

    Model Execute permission on Reorder Stock for Manager

    To model that the manager can have a look at sales orders
    Right click on the cell that intersects Manager and Process order. Select R: Read from the list. R should appear in that cell.

    Model Read permission on Process Order for Manager

    Model Read permission on Process Order for Manager

    Repeat to set the remaining permissions as shown.

    1. Customers place orders (E) and write comments (E) for feedback.
    2. Delivery staff makes delivery (E) for items ordered.
    3. Sales clerks process orders (E) and sometimes refer to delivery orders for information (R).

      Matrix completed

      Matrix completed

So what happens to the matrix if I add a new use case afterwards?

Let’s just say that we add a new use case called Do Survey to the use case diagram (after we’ve completed the matrix with the steps above).

Added a new use case to the use case diagram

Added a new use case to the use case diagram

If you return to the matrix, you’ll see that a new column called Do Survey has been inserted into the matrix to reflect the new addition to the diagram.

New column for the new use case automatically

New column for the new use case automatically

Related Links

Related Articles

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply