From ed9c353b95d8cb9a80387f2bc6e8b329b7643217 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 31 Jul 2023 19:22:33 -0600 Subject: [PATCH] Added read result to default policy allow for all nodes --- policy.go | 3 ++- signal.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/policy.go b/policy.go index e2cacfc..a693cd0 100644 --- a/policy.go +++ b/policy.go @@ -327,8 +327,9 @@ func (ext *ACLExt) Field(name string) interface{} { } var ErrorSignalAction = Action{"ERROR_RESP"} +var ReadResultSignalAction = Action{"READ_RESULT"} var DefaultACLPolicies = []Policy{ - NewAllNodesPolicy(Actions{ErrorSignalAction}), + NewAllNodesPolicy(Actions{ErrorSignalAction, ReadResultSignalAction}), } func NewACLExt(policies ...Policy) *ACLExt { diff --git a/signal.go b/signal.go index d82f2c4..e910194 100644 --- a/signal.go +++ b/signal.go @@ -276,6 +276,10 @@ type ReadResultSignal struct { Extensions map[ExtType]map[string]interface{} `json:"extensions"` } +func (signal ReadResultSignal) Permission() Action { + return ReadResultSignalAction +} + func NewReadResultSignal(req_id uuid.UUID, node_type NodeType, exts map[ExtType]map[string]interface{}) ReadResultSignal { return ReadResultSignal{ BaseSignal: BaseSignal{