diff --git a/pkg/arvo/app/chat-store.hoon b/pkg/arvo/app/chat-store.hoon index a21211cfc..c993d37e4 100644 --- a/pkg/arvo/app/chat-store.hoon +++ b/pkg/arvo/app/chat-store.hoon @@ -278,7 +278,7 @@ =/ app-rid=resource (path-to-resource path) =/ group-rid=resource - (fall (group-from-app-resource:met %graph app-rid) [nobody %bad-group]) + (fall (peek-group:met %graph app-rid) [nobody %bad-group]) =/ group=(unit group) (scry-group:grp group-rid) :- (add-graph app-rid mailbox) diff --git a/pkg/arvo/app/graph-push-hook.hoon b/pkg/arvo/app/graph-push-hook.hoon index 420311729..3fecbb701 100644 --- a/pkg/arvo/app/graph-push-hook.hoon +++ b/pkg/arvo/app/graph-push-hook.hoon @@ -25,13 +25,13 @@ ^- ? =/ grp ~(. group bowl) =/ met ~(. metadata bowl) - =/ groups - (groups-from-resource:met [%graph resource]) - ?~ groups %.n + =/ group=(unit resource:res) + (peek-group:met [%graph resource]) + ?~ group %.n ?: requires-admin - (is-admin:grp src.bowl i.groups) - ?| (is-member:grp src.bowl i.groups) - (is-admin:grp src.bowl i.groups) + (is-admin:grp src.bowl u.group) + ?| (is-member:grp src.bowl u.group) + (is-admin:grp src.bowl u.group) == :: ++ is-allowed-remove diff --git a/pkg/arvo/app/hark-graph-hook.hoon b/pkg/arvo/app/hark-graph-hook.hoon index 68dfd65e3..25d6dd954 100644 --- a/pkg/arvo/app/hark-graph-hook.hoon +++ b/pkg/arvo/app/hark-graph-hook.hoon @@ -192,7 +192,7 @@ |= rid=resource ^- (quip card _state) =/ group-rid=(unit resource) - (group-from-app-resource:met %graph rid) + (peek-group:met %graph rid) ?~ group-rid ~& no-group+rid `state @@ -217,12 +217,12 @@ rid=resource == =/ group=(unit resource) - (group-from-app-resource:met %graph rid) + (peek-group:met %graph rid) ?~ group ~& no-group+rid `state =/ metadata=(unit metadata:metadata-store) - (peek-metadata:met %graph u.group rid) + (peek-metadata:met %graph rid) ?~ metadata `state abet:check:(abed:handle-update:ha rid nodes u.group module.u.metadata) -- diff --git a/pkg/arvo/lib/metadata-json.hoon b/pkg/arvo/lib/metadata-json.hoon index 329471412..2f6a6bb13 100644 --- a/pkg/arvo/lib/metadata-json.hoon +++ b/pkg/arvo/lib/metadata-json.hoon @@ -1,5 +1,6 @@ /- *metadata-store /+ resource +^? |% ++ associations-to-json |= =associations diff --git a/pkg/arvo/lib/metadata.hoon b/pkg/arvo/lib/metadata.hoon index 279f4852c..fb1913de8 100644 --- a/pkg/arvo/lib/metadata.hoon +++ b/pkg/arvo/lib/metadata.hoon @@ -1,7 +1,7 @@ :: metadata: helpers for getting data from the metadata-store :: /- *metadata-store -/+ res=resource +/+ resource :: |_ =bowl:gall ++ app-paths-from-group @@ -22,38 +22,20 @@ ?. =(app-name.md-resource app-name) ~ `resource.md-resource :: -++ peek-metadata - |= [app-name=term =group=resource:res =app=resource:res] - ^- (unit metadata) - =/ group-cord=cord (scot %t (spat (en-path:res group-resource))) - =/ app-cord=cord (scot %t (spat (en-path:res app-resource))) - =/ our=cord (scot %p our.bowl) - =/ now=cord (scot %da now.bowl) - .^ (unit metadata) +++ peek-association + |= [app-name=term rid=resource] + .^ (unit association) %gx (scot %p our.bowl) %metadata-store (scot %da now.bowl) - %metadata group-cord app-name app-cord /noun + %metadata app-name (en-path:resource rid) %noun == :: -++ group-from-app-resource +++ peek-metadata |= =md-resource - ^- (unit resource:res) - =/ groups (groups-from-resource md-resource) - ?~ groups ~ - `i.groups + %+ bind (peek-association md-resource) + |=(association metadata) :: -++ groups-from-resource +++ peek-group |= =md-resource - ^- (list resource) - =; resources - %~ tap in - %+ ~(gut by resources) - md-resource - *(set resource) - .^ (jug ^md-resource resource) - %gy - (scot %p our.bowl) - %metadata-store - (scot %da now.bowl) - /resource-indices - == + %+ bind (peek-association md-resource) + |=(association group) -- diff --git a/pkg/arvo/mar/metadata/update.hoon b/pkg/arvo/mar/metadata/update.hoon index aed47bd2d..50760233c 100644 --- a/pkg/arvo/mar/metadata/update.hoon +++ b/pkg/arvo/mar/metadata/update.hoon @@ -1,3 +1,4 @@ +/- *metadata-store /+ *metadata-json |_ upd=metadata-update ++ grad %noun diff --git a/pkg/arvo/sur/metadata-store.hoon b/pkg/arvo/sur/metadata-store.hoon index 4e61af3e3..acdc9d2fb 100644 --- a/pkg/arvo/sur/metadata-store.hoon +++ b/pkg/arvo/sur/metadata-store.hoon @@ -1,4 +1,5 @@ /- *resource +^? |% :: +$ group-path path