diff --git a/pkg/arvo/lib/metadata-json.hoon b/pkg/arvo/lib/metadata-json.hoon index d8784c41c..a8ca48af3 100644 --- a/pkg/arvo/lib/metadata-json.hoon +++ b/pkg/arvo/lib/metadata-json.hoon @@ -53,6 +53,13 @@ ?> ?=([%s *] jon) (rash p.jon hex) :: + ++ permissions + %- su + ;~ pose + (tag %$) + (tag %reader-comments) + == + :: ++ metadata %- ot :~ [%title so] @@ -63,8 +70,11 @@ [%module so] [%picture so] [%preview bo] + [%permissions permissions] == :: + ++ tag |*(a=@tas (cold a (jest a))) + :: ++ md-resource ^- $-(json ^md-resource) %- ot @@ -86,6 +96,7 @@ [%module s+module.met] [%picture s+picture.met] [%preview b+preview.met] + [%permissions s+`@t`permissions.met] == :: ++ update-to-json diff --git a/pkg/arvo/sur/metadata-store.hoon b/pkg/arvo/sur/metadata-store.hoon index 08dc8ff8e..1b4949302 100644 --- a/pkg/arvo/sur/metadata-store.hoon +++ b/pkg/arvo/sur/metadata-store.hoon @@ -18,6 +18,17 @@ :: +$ color @ux +$ url @t +:: +:: $permissions: tag identifying variation in permissions +:: +:: This will be passed to the graph-permissions mark +:: conversion to allow for custom permissions. +:: +:: %reader-comments: Allow readers to comment, regardless +:: of whether they can write. +:: %$: No variation +:: ++$ permissions ?(%reader-comments %$) +$ metadata $: title=cord description=cord @@ -27,6 +38,7 @@ module=term picture=url preview=? + =permissions == :: +$ metadata-action diff --git a/pkg/interface/src/logic/api/metadata.ts b/pkg/interface/src/logic/api/metadata.ts index f82c3cb24..993c85ea5 100644 --- a/pkg/interface/src/logic/api/metadata.ts +++ b/pkg/interface/src/logic/api/metadata.ts @@ -22,7 +22,9 @@ export default class MetadataApi extends BaseApi { color, 'date-created': dateCreated, creator, - 'module': moduleName + 'module': moduleName, + preview: false, + permissions: '' } } }); diff --git a/pkg/interface/src/types/metadata-update.ts b/pkg/interface/src/types/metadata-update.ts index 5774fe4ed..4aff129d5 100644 --- a/pkg/interface/src/types/metadata-update.ts +++ b/pkg/interface/src/types/metadata-update.ts @@ -62,4 +62,7 @@ export interface Metadata { module: string; url: string; preview: boolean; + permissions: Permissions; } + +export type Permissions = '' | 'reader-comments';