From 5dd27ebf5937f67794f13859b423993d8e644db5 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 5 Mar 2021 12:26:30 -0600 Subject: [PATCH] graph-validator-post: built initial graph-validator for group feed --- pkg/arvo/mar/graph/validator/post.hoon | 30 +++++++++++++++++++++++ pkg/arvo/mar/graph/validator/publish.hoon | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 pkg/arvo/mar/graph/validator/post.hoon diff --git a/pkg/arvo/mar/graph/validator/post.hoon b/pkg/arvo/mar/graph/validator/post.hoon new file mode 100644 index 000000000..64e9f07b3 --- /dev/null +++ b/pkg/arvo/mar/graph/validator/post.hoon @@ -0,0 +1,30 @@ +/- *post, met=metadata-store +|_ i=indexed-post +++ grow + |% + ++ noun i + ++ graph-permissions-add + |= vip=vip-metadata:met + ?: ?=([@ ~] index.p.i) + [%yes %yes %no] + [%yes %yes ?:(?=(%reader-comments vip) %yes %no)] + :: + ++ graph-permissions-remove + |= vip=vip-metadata:met + [%yes %self %self] + :: +notification-kind: no notifications for now + :: + ++ notification-kind ~ + -- +++ grab + |% + :: +noun: validate post + :: + ++ noun + |= p=* + =/ ip ;;(indexed-post p) + ?> ?=(^ contents.p.ip) + -- +:: +++ grad %noun +-- diff --git a/pkg/arvo/mar/graph/validator/publish.hoon b/pkg/arvo/mar/graph/validator/publish.hoon index 62fc8c466..9b5278083 100644 --- a/pkg/arvo/mar/graph/validator/publish.hoon +++ b/pkg/arvo/mar/graph/validator/publish.hoon @@ -33,7 +33,7 @@ -- ++ grab |% - :: +noun: validate publish post + :: +noun: validate publish note :: ++ noun |= p=*