Refinement of the rights model
A typical requirement, especially in large organizations, is that information may only be viewed by the correspondingly affected persons. We want to simulate this using the following situation: a ticket may only be checked by the manager assigned to the product.
For this reason, we have also defined two managers in the test data, one of whom is responsible for exactly one product, while the other is responsible for 2.
Therefore, the corresponding manager (or developer and tester) must be determined for a ticket. We can find this manager in our model by following the red line exactly.
As already explained in the"TopLogic Script" chapter, we now enter the following code in the process model in the Actor function field of the lane for the product manager. We also delete the entry in the Actors group.
x->$x.get(`MyEntities:Ticket#refersTo`).get(`MyEntities:Product#managedBy`)
Explanation:
- x declares the variable we are working with here.
- By ->$x the variable is accessed.
- .get tells the system to read from the model.
- What is to be read out is in the parenthesis. It is read here from the ticket to the associated product.
The further reading from the object product to the object person (the second red line) is triggered by the second .get statement.
Accordingly, we enter x->$x.get(`MyEntities:Ticket#refersTo`).get(`MyEntities:Product#developers`) or x->$x.get(`MyEntities:Ticket#refersTo`).get(`MyEntities:Product#testers`) in the Developer or Tester lane.
For pure time reasons, we will do without the analogous checks during implementation and testing during installation, especially since we also have only one user each here with whom we could fulfill the prerequisites.