-
Notifications
You must be signed in to change notification settings - Fork 1
/
permissions.acl
142 lines (125 loc) · 4.86 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
/**
* Access Control List for the buying network.
*/
rule MembersCanViewALLData {
description: "Allow all participants read access to all resources"
participant(m): "com.authmeds.prescription.redeem.User"
operation: READ
resource(v): "com.authmeds.prescription.redeem.*"
condition: (v.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule PharmacistCanViewMemberData {
description: "Allow all participants read access to all resources"
participant: "com.authmeds.prescription.redeem.Pharmacist"
operation: READ
resource: "com.authmeds.prescription.redeem.Patient"
action: ALLOW
}
rule PharmacistCanUpdateData {
description: "Allow all seller access to all resources"
participant(m): "com.authmeds.prescription.redeem.Pharmacist"
operation: ALL
resource(v): "com.authmeds.prescription.redeem.Pharmacist"
condition: (v.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule PrescriptionView {
description: "Allow Patients all access to their prescriptions"
participant: "com.authmeds.prescription.redeem.Patient"
operation: READ
resource: "com.authmeds.prescription.redeem.Prescription"
action: ALLOW
}
rule PrescriptionAccess {
description: "Allow Users all access to their prescriptions"
participant(m): "com.authmeds.prescription.redeem.User"
operation: ALL
resource(v): "com.authmeds.prescription.redeem.Prescription"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule PrescriptionListingView {
description: "Allow the owner of a prescription total access to their listing"
participant: "com.authmeds.prescription.redeem.User"
operation: READ
resource: "com.authmeds.prescription.redeem.PrescriptionListing"
action: ALLOW
}
rule PrescriptionListingOwner {
description: "Allow the pharmacist of a prescription total access to their listing"
participant(m): "com.authmeds.prescription.redeem.Pharmacist"
operation: ALL
resource(v): "com.authmeds.prescription.redeem.PrescriptionListing"
condition: (v.prescription.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule AddPrescription{
description: "Allow Doctors to add new prescription"
participant(m): "com.authmeds.prescription.redeem.Doctor"
operation: CREATE
resource(v): "com.authmeds.prescription.redeem.AddPrescription"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule MakeOffer{
description: "Allow members to buy for the prescription"
participant(m): "com.authmeds.prescription.redeem.User"
operation: CREATE
resource(v): "com.authmeds.prescription.redeem.Offer"
condition: (v.member.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule MembersCanUpdatePrescriptionListing {
description: "Allow the members to update their buy for the listing"
participant: "com.authmeds.prescription.redeem.User"
operation: UPDATE
resource: "com.authmeds.prescription.redeem.PrescriptionListing"
action: ALLOW
}
rule StartCounterProcessTransaction {
description: "Allow owner of prescription to start the buying"
participant(m): "com.authmeds.prescription.redeem.User"
operation: CREATE
resource(v): "com.authmeds.prescription.redeem.StartCounter"
condition: (v.prescription.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule CloseCounterProcessTransaction {
description: "Allow owner of prescription to close the buying"
participant(m): "com.authmeds.prescription.redeem.User"
operation: CREATE
resource(v): "com.authmeds.prescription.redeem.CloseCounter"
condition: (v.listing.prescription.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule CloseCounterProcessTransactionUpdate {
description: "Allow members to buy for the prescription"
participant(m): "com.authmeds.prescription.redeem.User"
operation: UPDATE
resource(v): "com.authmeds.prescription.redeem.User"
transaction(tx): "com.authmeds.prescription.redeem.CloseCounter"
condition: (tx.listing.prescription.owner.getIdentifier() == m.getIdentifier())
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
}