From f118dde221e0eef161e97d09b60a69b63d8a6b50 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 24 Jul 2023 20:45:07 -0600 Subject: [PATCH] Add policies to write context --- node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.go b/node.go index 5cd542c..e6d94b9 100644 --- a/node.go +++ b/node.go @@ -225,7 +225,7 @@ func Signal(context *StateContext, node Node, princ Node, signal GraphSignal) er func AttachPolicies(ctx *Context, node Node, policies ...Policy) error { context := NewWriteContext(ctx) - return UpdateStates(context, node, NewLockInfo(node, []string{"policies"}), func(context *StateContext) error { + return UpdateStates(context, node, NewLockMap(NewLockInfo(node, []string{"policies"}), LockList(policies, nil)), func(context *StateContext) error { for _, policy := range(policies) { node.NodeHandle().PolicyMap[policy.ID()] = policy }