This repository was archived by the owner on May 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathpermissions.acl
141 lines (125 loc) · 4.5 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 bidding network.
*/
rule MembersCanViewALLData {
description: "Allow all participants read access to all resources"
participant(m): "org.acme.product.auction.User"
operation: READ
resource(v): "org.acme.product.auction.*"
condition: (v.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule SellerCanViewMemberData {
description: "Allow all participants read access to all resources"
participant: "org.acme.product.auction.Seller"
operation: READ
resource: "org.acme.product.auction.Member"
action: ALLOW
}
rule SellerCanUpdateData {
description: "Allow all seller access to all resources"
participant(m): "org.acme.product.auction.Seller"
operation: ALL
resource(v): "org.acme.product.auction.Seller"
condition: (v.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule ProductView {
description: "Allow Users all access to their products"
participant: "org.acme.product.auction.User"
operation: READ
resource: "org.acme.product.auction.Product"
action: ALLOW
}
rule ProductAccess {
description: "Allow Users all access to their products"
participant(m): "org.acme.product.auction.User"
operation: ALL
resource(v): "org.acme.product.auction.Product"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule ProductListingView {
description: "Allow the owner of a product total access to their listing"
participant: "org.acme.product.auction.User"
operation: READ
resource: "org.acme.product.auction.ProductListing"
action: ALLOW
}
rule ProductListingOwner {
description: "Allow the owner of a product total access to their listing"
participant(m): "org.acme.product.auction.User"
operation: ALL
resource(v): "org.acme.product.auction.ProductListing"
condition: (v.product.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule AddProduct{
description: "Allow Sellers to add new product"
participant(m): "org.acme.product.auction.Seller"
operation: CREATE
resource(v): "org.acme.product.auction.AddProduct"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule MakeOffer{
description: "Allow members to bid for the product"
participant(m): "org.acme.product.auction.User"
operation: CREATE
resource(v): "org.acme.product.auction.Offer"
condition: (v.member.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule MembersCanUpdateProductListing {
description: "Allow the members to update their bid for the listing"
participant: "org.acme.product.auction.User"
operation: UPDATE
resource: "org.acme.product.auction.ProductListing"
action: ALLOW
}
rule StartBiddingProcessTransaction {
description: "Allow owner of product to start the bidding"
participant(m): "org.acme.product.auction.User"
operation: CREATE
resource(v): "org.acme.product.auction.StartBidding"
condition: (v.product.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule CloseBiddingProcessTransaction {
description: "Allow owner of product to close the bidding"
participant(m): "org.acme.product.auction.User"
operation: CREATE
resource(v): "org.acme.product.auction.CloseBidding"
condition: (v.listing.product.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule CloseBiddingProcessTransactionUpdate {
description: "Allow members to bid for the product"
participant(m): "org.acme.product.auction.User"
operation: UPDATE
resource(v): "org.acme.product.auction.User"
transaction(tx): "org.acme.product.auction.CloseBidding"
condition: (tx.listing.product.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
}