graph-push-hook: find group associated with app resource

This commit is contained in:
Logan Allen 2020-09-15 12:29:26 -05:00
parent e2670deba3
commit 5d5d93e663

View File

@ -1,4 +1,5 @@
/+ store=graph-store /+ store=graph-store
/+ met=metadata
/+ res=resource /+ res=resource
/+ graph /+ graph
/+ group /+ group
@ -18,6 +19,14 @@
== ==
:: ::
+$ agent (push-hook:push-hook config) +$ agent (push-hook:push-hook config)
::
++ is-member
|= [=resource:res =bowl:gall]
^- ?
=/ grp ~(. group bowl)
=/ group-paths (groups-from-resource:met [%graph (en-path:res resource)])
?~ group-paths %.n
(is-member:grp src.bowl i.group-paths)
-- --
:: ::
%- agent:dbug %- agent:dbug
@ -44,30 +53,23 @@
++ should-proxy-update ++ should-proxy-update
|= =vase |= =vase
^- ? ^- ?
|^
=/ =update:store !<(update:store vase) =/ =update:store !<(update:store vase)
?- -.q.update ?- -.q.update
%add-graph (is-member resource.q.update) %add-graph (is-member resource.q.update bowl)
%remove-graph (is-member resource.q.update) %remove-graph (is-member resource.q.update bowl)
%add-nodes (is-member resource.q.update) %add-nodes (is-member resource.q.update bowl)
%remove-nodes (is-member resource.q.update) %remove-nodes (is-member resource.q.update bowl)
%add-signatures (is-member resource.uid.q.update) %add-signatures (is-member resource.uid.q.update bowl)
%remove-signatures (is-member resource.uid.q.update) %remove-signatures (is-member resource.uid.q.update bowl)
%archive-graph (is-member resource.q.update) %archive-graph (is-member resource.q.update bowl)
%unarchive-graph %.n %unarchive-graph %.n
%add-tag %.n %add-tag %.n
%remove-tag %.n %remove-tag %.n
%keys %.n %keys %.n
%tags %.n %tags %.n
%tag-queries %.n %tag-queries %.n
%run-updates (is-member resource.q.update) %run-updates (is-member resource.q.update bowl)
== ==
::
++ is-member
|= =resource:res
^- ?
(is-member:grp src.bowl (en-path:res resource))
--
:: ::
++ resource-for-update ++ resource-for-update
|= =vase |= =vase
@ -93,7 +95,7 @@
++ initial-watch ++ initial-watch
|= [=path =resource:res] |= [=path =resource:res]
^- vase ^- vase
?> (is-member:grp src.bowl (en-path:res resource)) ?> (is-member resource bowl)
!> ^- update:store !> ^- update:store
?~ path ?~ path
:: new subscribe :: new subscribe