-
Notifications
You must be signed in to change notification settings - Fork 0
/
permissions.acl
188 lines (163 loc) · 6.27 KB
/
permissions.acl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/**
* Access control rules for decentralized-energy-network
*/
//Residents to have access only to their own account
rule ResidentAccessOwnRecord {
description: "Allow residents to access only their profile"
participant(p): "org.decentralized.energy.network.Resident"
operation: READ, UPDATE, DELETE
resource(r): "org.decentralized.energy.network.Resident"
condition: (r.getIdentifier() === p.getIdentifier())
action: ALLOW
}
//Residents to have read only access to other Residents
rule ResidentReadAccessResidents {
description: "Allow residents read access to other residents"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.Resident"
action: ALLOW
}
//Residents to have read only access to other Banks
rule ResidentReadAccessBanks {
description: "Allow residents read access to other banks"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.Bank"
action: ALLOW
}
//Residents to have read only access to other Utility Companies
rule ResidentReadAccessUtilityCompanies {
description: "Allow residents read access to other utility companies"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.UtilityCompany"
action: ALLOW
}
//Residents to have read access to all coins assets
rule ResidentAccessCoinsRecord {
description: "Allow residents read access to all coins assets"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.Coins"
action: ALLOW
}
//Residents to have read access to all energy assets
rule ResidentAccessEnergyRecord {
description: "Allow residents read access to all energy assets"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.Energy"
action: ALLOW
}
//Residents to have read access to all cash assets
rule ResidentAccessCashRecord {
description: "Allow residents read access to all cash assets"
participant: "org.decentralized.energy.network.Resident"
operation: READ
resource: "org.decentralized.energy.network.Cash"
action: ALLOW
}
//Banks to have access to their own account
rule BankAccessOwnRecord {
description: "Allow banks to access only their profile"
participant(p): "org.decentralized.energy.network.Bank"
operation: READ, UPDATE, DELETE
resource(r): "org.decentralized.energy.network.Bank"
condition: (r.getIdentifier() === p.getIdentifier())
action: ALLOW
}
//Banks to have read only access to other Banks
rule BankReadAccessBanks {
description: "Allow banks read access to other Banks"
participant: "org.decentralized.energy.network.Bank"
operation: READ
resource: "org.decentralized.energy.network.Bank"
action: ALLOW
}
//Banks to have read only access to other Residents
rule BankReadAccessResidents {
description: "Allow banks read access to other Residents"
participant: "org.decentralized.energy.network.Bank"
operation: READ
resource: "org.decentralized.energy.network.Resident"
action: ALLOW
}
//Banks to have read access to all coins assets
rule BankAccessCoinsRecord {
description: "Allow banks read access to all coins assets"
participant: "org.decentralized.energy.network.Bank"
operation: READ
resource: "org.decentralized.energy.network.Coins"
action: ALLOW
}
//Banks to have read/update access to all cash assets
rule BankAccessCashRecord {
description: "Allow banks read access to all cash assets"
participant: "org.decentralized.energy.network.Bank"
operation: READ
resource: "org.decentralized.energy.network.Cash"
action: ALLOW
}
//Utility Companies to have access to their own account
rule UtilityCompanyAccessOwnRecord {
description: "Allow utilty company to access only their profile"
participant(p): "org.decentralized.energy.network.UtilityCompany"
operation: READ, UPDATE, DELETE
resource(r): "org.decentralized.energy.network.UtilityCompany"
condition: (r.getIdentifier() === p.getIdentifier())
action: ALLOW
}
//Utility Companies to have read only access to other Utility Companies
rule UtilityCompanyReadAccessUtilityCompanies {
description: "Allow utility companies read access to other Utility Companies"
participant: "org.decentralized.energy.network.UtilityCompany"
operation: READ
resource: "org.decentralized.energy.network.UtilityCompany"
action: ALLOW
}
//Utility Companies to have read only access to other Residents
rule UtilityCompanyReadAccessResidents {
description: "Allow utility companies read access to other Residents"
participant: "org.decentralized.energy.network.UtilityCompany"
operation: READ
resource: "org.decentralized.energy.network.Resident"
action: ALLOW
}
//Utility Companies to have read access to all coins assets
rule UtilityCompanyAccessCoinsRecord {
description: "Allow utility companies read access to all coins assets"
participant: "org.decentralized.energy.network.UtilityCompany"
operation: READ
resource: "org.decentralized.energy.network.Coins"
action: ALLOW
}
//Utility Companies to have read/update access to all energy assets
rule UtilityCompanyAccessEnergyRecord {
description: "Allow utility companies read access to all energy assets"
participant: "org.decentralized.energy.network.UtilityCompany"
operation: READ
resource: "org.decentralized.energy.network.Energy"
action: ALLOW
}
rule SystemACL {
description: "System ACL to permit all access"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
rule NetworkAdminSystem {
description: "Grant business network administrators full access to system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}