metadata-store: add permissions field

This commit is contained in:
Liam Fitzgerald 2021-01-20 11:51:07 +10:00
parent 8541886433
commit 871fba20a3
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
4 changed files with 29 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -22,7 +22,9 @@ export default class MetadataApi extends BaseApi<StoreState> {
color,
'date-created': dateCreated,
creator,
'module': moduleName
'module': moduleName,
preview: false,
permissions: ''
}
}
});

View File

@ -62,4 +62,7 @@ export interface Metadata {
module: string;
url: string;
preview: boolean;
permissions: Permissions;
}
export type Permissions = '' | 'reader-comments';