@@ -23,8 +23,10 @@ import (
23
23
"github.com/hyperledger/fabric/common/configtx"
24
24
genesisconfig "github.com/hyperledger/fabric/common/configtx/tool/localconfig"
25
25
configtxchannel "github.com/hyperledger/fabric/common/configvalues/channel"
26
+ configtxapplication "github.com/hyperledger/fabric/common/configvalues/channel/application"
26
27
configtxorderer "github.com/hyperledger/fabric/common/configvalues/channel/orderer"
27
28
"github.com/hyperledger/fabric/common/genesis"
29
+ "github.com/hyperledger/fabric/common/policies"
28
30
"github.com/hyperledger/fabric/orderer/common/bootstrap"
29
31
cb "github.com/hyperledger/fabric/protos/common"
30
32
ab "github.com/hyperledger/fabric/protos/orderer"
@@ -54,6 +56,15 @@ const (
54
56
55
57
// AcceptAllPolicyKey is the key of the AcceptAllPolicy.
56
58
AcceptAllPolicyKey = "AcceptAllPolicy"
59
+
60
+ // ReadersPolicyKey is the key used for the read policy
61
+ ReadersPolicyKey = "Readers"
62
+
63
+ // WritersPolicyKey is the key used for the read policy
64
+ WritersPolicyKey = "Writers"
65
+
66
+ // AdminsPolicyKey is the key used for the read policy
67
+ AdminsPolicyKey = "Admins"
57
68
)
58
69
59
70
// DefaultChainCreationPolicyNames is the default value of ChainCreatorsKey.
@@ -85,8 +96,22 @@ func New(conf *genesisconfig.TopLevel) Generator {
85
96
configtxorderer .TemplateEgressPolicyNames ([]string {AcceptAllPolicyKey }),
86
97
87
98
// Policies
88
- cauthdsl .TemplatePolicy (configtx .NewConfigItemPolicyKey , cauthdsl .RejectAllPolicy ),
89
99
cauthdsl .TemplatePolicy (AcceptAllPolicyKey , cauthdsl .AcceptAllPolicy ),
100
+
101
+ // Initialize the default Reader/Writer/Admins channel policies
102
+ policies .TemplateImplicitMetaAnyPolicy ([]string {}, ReadersPolicyKey ),
103
+ policies .TemplateImplicitMetaAnyPolicy ([]string {}, WritersPolicyKey ),
104
+ policies .TemplateImplicitMetaMajorityPolicy ([]string {}, AdminsPolicyKey ),
105
+
106
+ // Initialize the default Reader/Writer/Admins orderer policies
107
+ policies .TemplateImplicitMetaAnyPolicy ([]string {configtxorderer .GroupKey }, ReadersPolicyKey ),
108
+ policies .TemplateImplicitMetaAnyPolicy ([]string {configtxorderer .GroupKey }, WritersPolicyKey ),
109
+ policies .TemplateImplicitMetaMajorityPolicy ([]string {configtxorderer .GroupKey }, AdminsPolicyKey ),
110
+
111
+ // Initialize the default Reader/Writer/Admins application policies
112
+ policies .TemplateImplicitMetaAnyPolicy ([]string {configtxapplication .GroupKey }, ReadersPolicyKey ),
113
+ policies .TemplateImplicitMetaAnyPolicy ([]string {configtxapplication .GroupKey }, WritersPolicyKey ),
114
+ policies .TemplateImplicitMetaMajorityPolicy ([]string {configtxapplication .GroupKey }, AdminsPolicyKey ),
90
115
},
91
116
92
117
systemChainGroups : []* cb.ConfigGroup {
0 commit comments