## 6 Case Study 2-- ITMI: IoT
### The Solution: HEAD Metamodel
#### 6.2.3 Phase 3: NGAC--The Policy Enforcement Point  
The generated Cypher statements, which are Java outputs, are used as inputs for NGAC authorization responses. However, they are injected into the Neo4j database to represent the AC policy as an NGAC policy graph in Figure 23. The dark brown, green, and blue nodes refer to PC1, and the light brown, green, and blue nodes refer to PC2. As shown in the graph on the left, the dark/light brown nodes represent the assignment of users (Us) to their UA containers, in addition to the role hierarchy, which is indicated by the red arrow, and 'has_child_content' relationship. In the left section of the graph, the dark/light brown with the dark/light blue nodes show the assignment of objects (Os) to their OA containers, in addition to object hierarchy which is depicted by the red arrow and 'include' relationship. The association relationships, the yellow arrows for PC1 and the dark brown arrows for PC2, indicate users' access rights.  
Due to the inheritance relationship between the manager and the adviser roles, in Figure 24 we show some access rights examples associated with the manager [PERSON] and the users who are assigned to the Workers (UA) container. In Figure 24a, [PERSON] has ManPermission to {cn: confirm} data in Results and IoTData containers. He also has the permission AdvPermission to {w, u, d} Results and {r, cp} IoTData through the Manager-Adviser assignment which is expressed as 'has_child_content' relationship to represent role hierarchy. In Figure 24b, we show the access rights associated to the workers [PERSON], [PERSON], and [PERSON] to {d} IoTData in a certain context and {oc:operate, ct:control} the RailRobot and the Drone. In Figure 24c, we show the set of permissions associated with users to perform operations on the IoTData object container.  
Figure 22: Case Study 2: A sample of Cypher statements (a) PC, U, and O nodes; (b) UAs of roles with U-UA assignment; and (c) a sample U-UA assignment of PC2.  
Figure 21: Case Study 2: Java output sample (a) to configure PC1/PC2; (b) user-role assignment.  
Similar to case study 1, to avoid multiple association relationships between UA and OA containers we use single association relationship, for example between Adviser and Results. In Figure 25 we show an example with double association relationships between Adviser and Results. The first association is to express the {w, u, d} operations and the  
Figure 23: Case Study 2: NGAC graph.  
Figure 24: Case Study 2: Examples of Users’ access rights (**a**) for Manager; (**b**) for Workers; (**c**) for users to access IoTData object.  
second association is to express the {r} operation and express the constraints with each association.  
The Neo4j platform is used to run some Cypher queries with some contextual and non-contextual constraints to present NGAC authorization responses. In Figure 26a, the Workers are able to {d} IoTData when the value of InspectionStatus = 'inprogress', which means the inspection process is not completed and more data need to be collected, but when the value of InspectionStatus is updated (by the manager) to 'complete' as illustrated in (b), the workers would not be allowed to delete the IoTData even if they are logged into the system via the public network as shown in (c). In Figure 26d we show that a Worker can {o,ct} the Rail Robot or the Drone if the pwAttpmts are less than or equal to three attempts, otherwise (e) be would not.