From 9702c5a86c08475685a024ea4af71e4844c4965c Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Tue, 3 Nov 2020 10:20:15 +1000 Subject: [PATCH] graph-push-hook: allow for node removal by post author --- pkg/arvo/app/graph-push-hook.hoon | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/app/graph-push-hook.hoon b/pkg/arvo/app/graph-push-hook.hoon index 5b4ea54b33..422901bd15 100644 --- a/pkg/arvo/app/graph-push-hook.hoon +++ b/pkg/arvo/app/graph-push-hook.hoon @@ -32,6 +32,22 @@ ?| (is-member:grp src.bowl i.group-paths) (is-admin:grp src.bowl i.group-paths) == +:: +++ is-allowed-remove + |= [=resource:res indices=(set index:store) =bowl:gall] + ^- ? + =/ gra ~(. graph bowl) + ?. (is-allowed resource bowl %.n) + %.n + %+ levy + ~(tap in indices) + |= =index:store + ^- ? + =/ =node:store + (get-node:gra resource index) + ?| =(author.post.node src.bowl) + (is-allowed resource bowl %.y) + == -- :: %- agent:dbug @@ -63,7 +79,7 @@ %add-graph (is-allowed resource.q.update bowl %.y) %remove-graph (is-allowed resource.q.update bowl %.y) %add-nodes (is-allowed resource.q.update bowl %.n) - %remove-nodes (is-allowed resource.q.update bowl %.y) + %remove-nodes (is-allowed-remove resource.q.update indices.q.update bowl) %add-signatures (is-allowed resource.uid.q.update bowl %.n) %remove-signatures (is-allowed resource.uid.q.update bowl %.y) %archive-graph (is-allowed resource.q.update bowl %.y)