From 0256296464b7bc1320bd0b782b9cae97537e7b4b Mon Sep 17 00:00:00 2001 From: handongxun Date: Mon, 13 Sep 2021 15:43:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20opendb-news-articles=20=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=85=8D=E7=BD=AE=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opendb-news-articles/collection.json | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/collection/opendb-news-articles/collection.json b/collection/opendb-news-articles/collection.json index 0bea48c..a33c06b 100644 --- a/collection/opendb-news-articles/collection.json +++ b/collection/opendb-news-articles/collection.json @@ -3,10 +3,10 @@ "bsonType": "object", "required": ["user_id", "title", "content"], "permission": { - "read": "doc.uid == auth.uid && doc.article_status == 0 || doc.article_status == 1", + "read": "doc.user_id == auth.uid && doc.article_status == 0 || doc.article_status == 1", "create": "auth.uid != null", - "update": "doc.uid == auth.uid", - "delete": "doc.uid == auth.uid" + "update": "doc.user_id == auth.uid", + "delete": "doc.user_id == auth.uid" }, "properties": { "_id": { @@ -35,29 +35,28 @@ "title": "标题", "description": "标题", "label": "标题", - "trim":"both" + "trim": "both" }, "content": { "bsonType": "string", "title": "文章内容", "description": "文章内容", "label": "文章内容", - "trim":"right" + "trim": "right" }, "excerpt": { "bsonType": "string", "title": "文章摘录", "description": "文章摘录", "label": "摘要", - "trim":"both" + "trim": "both" }, "article_status": { "bsonType": "int", "title": "文章状态", "description": "文章状态:0 草稿箱 1 已发布", - "defaultValue": 0, - "enum": [ - { + "defaultValue": 0, + "enum": [{ "value": 0, "text": "草稿箱" }, @@ -102,8 +101,7 @@ "bsonType": "int", "title": "开放评论", "description": "评论状态:0 关闭 1 开放", - "enum": [ - { + "enum": [{ "value": 0, "text": "关闭" }, @@ -130,7 +128,7 @@ "title": "封面大图", "description": "缩略图地址", "label": "封面大图", - "trim":"both" + "trim": "both" }, "publish_date": { "bsonType": "timestamp",