whenLargeValidPolicy_thenTrue.xml 4.39 KB
Newer Older
1
2
3
<?xml version="1.0" encoding="UTF-8"?>
<policy xmlns="http://www.iese.fraunhofer.de/ind2uce/3.0.25/enforcementLanguage" xmlns:tns="http://www.iese.fraunhofer.de/ind2uce/3.0.25/enforcementLanguage" xmlns:param="http://www.iese.fraunhofer.de/ind2uce/3.0.25/param"
  xmlns:pip="http://www.iese.fraunhofer.de/ind2uce/3.0.25/pip" xmlns:function="http://www.iese.fraunhofer.de/ind2uce/3.0.25/function" xmlns:constant="http://www.iese.fraunhofer.de/ind2uce/3.0.25/constant"
Raj Shah's avatar
Raj Shah committed
4
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="urn:policy:ppe:b" description="Policy for Fleet PoC Use Case 1">
5
6
7
8
9
10
11
12
13
14

  <preventiveMechanism id="decideOnStorageOfPositionUpdates">
    <description>Decides whether to store a position update coming from a vehicle.</description>
    <event action="urn:action:ppe:cr-writeData" >
      <param:boolean name="bla" />
      <param:boolean name="bla" value="true" />
    </event>
    <condition>
      <not>
        <function:contains>
Raj Shah's avatar
Raj Shah committed
15
          <pip:list method="urn:pip:ppe:currentTripEqualsType" default="[]" ttlAmount="30" />
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
          <constant:float value="214" />
        </function:contains>
        <!-- thingId is labeled as vehicleId -->
      </not>
    </condition>
    <authorizationDecision name="default_writeData" fallback="sasf">
      <allow>
        <modify>
          <param:event name="latitude">
            <function:engine method="delete" />
          </param:event>
          <param:event name="longitude">
            <function:engine method="delete" />
          </param:event>
        </modify>
      </allow>
    </authorizationDecision>
    <fallbackAuthorizationDecision name="sasf">
      <allow>
        <modify>
          <param:event name="latitude">
            <function:engine method="replace">
              <param:string name="newValue">
                <function:concat>
                  <param:double name="abc" />
                  <constant:string value="uuu" />
                </function:concat>
              </param:string>
            </function:engine>
          </param:event>
          <param:event name="longitude">
            <function:engine method="delete" />
          </param:event>
        </modify>
      </allow>
    </fallbackAuthorizationDecision>
  </preventiveMechanism>

  <preventiveMechanism id="aggregatePrivateTrips">
    <description>Decide whether to read private trips in detail or aggregated only.</description>
    <event action="urn:action:ppe:fleet-readTripData" >
    </event>
    <condition>
      <and>
        <not>
Raj Shah's avatar
Raj Shah committed
61
          <pip:boolean method="urn:pip:ppe:isAssignedDriver" default="false">
62
            <param:string name="userId">
Raj Shah's avatar
Raj Shah committed
63
              <pip:string method="urn:pip:ppe:getUserName" default="UNKNOWN">
64
65
66
67
68
69
70
                <param:string name="contextId" />
              </pip:string>
            </param:string>
          </pip:boolean>
        </not>
        <and>
          <!-- values of roleName are not known -->
Raj Shah's avatar
Raj Shah committed
71
          <pip:boolean method="urn:pip:ppe:hasRole" default="false">
72
73
74
75
76
            <param:string name="contextId" />
            <param:string name="roleName" value="FleetManager" />
            <!-- FleetManager, Driver -->
          </pip:boolean>
          <and>
Raj Shah's avatar
Raj Shah committed
77
            <pip:boolean method="urn:pip:ppe:isShowPrivateTripsAggregated" default="false">
78
              <param:string name="userName">
Raj Shah's avatar
Raj Shah committed
79
                <pip:string method="urn:pip:ppe:getUserName" default="UNKNOWN">
80
81
82
83
                  <param:string name="contextId" />
                </pip:string>
              </param:string>
            </pip:boolean>
Raj Shah's avatar
Raj Shah committed
84
            <pip:boolean method="urn:pip:ppe:isVehicleStolen" default="false">
85
86
87
88
89
90
91
92
93
94
95
96
97
98
              <param:string name="vehicleId">
                <param:string name="thingId" />
              </param:string>
            </pip:boolean>
          </and>
        </and>
      </and>
    </condition>
    <authorizationDecision name="default_readTripData">
      <allow>
        <modify>
          <param:event name="trips">
            <function:engine method="aggregate">
              <param:string name="carStolenDate">
Raj Shah's avatar
Raj Shah committed
99
                <pip:string method="urn:pip:ppe:getVehicleStolenDate" default="">
100
101
102
103
104
105
106
107
108
109
110
111
112
                  <param:string name="vehicleId">
                    <param:string name="fasdlkf" />
                  </param:string>
                </pip:string>
              </param:string>
            </function:engine>
          </param:event>
        </modify>
      </allow>
    </authorizationDecision>
  </preventiveMechanism>

</policy>