From e5525b7d9e26d9a5180318e0b7d5856c91bc1fe0 Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 21 Feb 2020 23:56:44 +0100 Subject: [PATCH] chat-hook: on-migrate, configure permission-hook also Permissions for the new group need to be exposed to the members of those new groups. This makes the on-migrate logic poke the permission-hook for that. --- pkg/arvo/app/chat-hook.hoon | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index b150de31d..07af3253b 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -2,8 +2,8 @@ :: mirror chat data from foreign to local based on read permissions :: allow sending chat messages to foreign paths based on write perms :: -/- *permission-store, *chat-hook, *invite-store, - *metadata-store, *permission-group-hook, *group-store +/- *permission-store, *chat-hook, *invite-store, *metadata-store, + *permission-hook, *group-store, *permission-group-hook ::TMP for upgrade /+ *chat-json, *chat-eval, default-agent, verb, dbug |% +$ card card:agent:gall @@ -79,10 +79,8 @@ == :: (create-group new-group who.newp) - :: - :~ (record-group new-group chat) - (hookup-group new-group kind.newp) - == + (hookup-group new-group kind.newp) + [(record-group new-group chat)]~ == :: ++ unify-permissions @@ -147,11 +145,20 @@ :: ++ hookup-group |= [group=path =kind] - ^- card - %^ make-poke %permission-group-hook - %permission-group-hook-action - !> ^- permission-group-hook-action - [%associate group [group^kind ~ ~]] + ^- (list card) + :* %^ make-poke %permission-group-hook + %permission-group-hook-action + !> ^- permission-group-hook-action + [%associate group [group^kind ~ ~]] + :: + =/ =ship (slav %p (snag 1 group)) + ?. =(our.bol ship) ~ + :_ ~ + %^ make-poke %permission-hook + %permission-hook-action + !> ^- permission-hook-action + [%add-owned group group] + == :: ++ record-group |= [group=path chat=path]