graph-push-hook: find group associated with app resource
/+ store=graph-store
+/+ met=metadata
/+ res=resource
/+ graph
/+ group
==
::
+$ 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
++ should-proxy-update
|= =vase
^- ?
- |^
=/ =update:store !<(update:store vase)
?- -.q.update
- %add-graph (is-member resource.q.update)
- %remove-graph (is-member resource.q.update)
- %add-nodes (is-member resource.q.update)
- %remove-nodes (is-member resource.q.update)
- %add-signatures (is-member resource.uid.q.update)
- %remove-signatures (is-member resource.uid.q.update)
- %archive-graph (is-member resource.q.update)
+ %add-graph (is-member resource.q.update bowl)
+ %remove-graph (is-member resource.q.update bowl)
+ %add-nodes (is-member resource.q.update bowl)
+ %remove-nodes (is-member resource.q.update bowl)
+ %add-signatures (is-member resource.uid.q.update bowl)
+ %remove-signatures (is-member resource.uid.q.update bowl)
+ %archive-graph (is-member resource.q.update bowl)
%unarchive-graph %.n
%add-tag %.n
%remove-tag %.n
%keys %.n
%tags %.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
|= =vase
^- (unit resource:res)
++ initial-watch
|= [=path =resource:res]
^- vase
- ?> (is-member:grp src.bowl (en-path:res resource))
+ ?> (is-member resource bowl)
!> ^- update:store
?~ path
:: new subscribe
