fix: opendb-news-articles 权限配置错误的问题

This commit is contained in:
handongxun 2021-09-13 15:43:20 +08:00
parent 61581227eb
commit 0256296464

View File

@ -3,10 +3,10 @@
"bsonType": "object", "bsonType": "object",
"required": ["user_id", "title", "content"], "required": ["user_id", "title", "content"],
"permission": { "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", "create": "auth.uid != null",
"update": "doc.uid == auth.uid", "update": "doc.user_id == auth.uid",
"delete": "doc.uid == auth.uid" "delete": "doc.user_id == auth.uid"
}, },
"properties": { "properties": {
"_id": { "_id": {
@ -35,29 +35,28 @@
"title": "标题", "title": "标题",
"description": "标题", "description": "标题",
"label": "标题", "label": "标题",
"trim":"both" "trim": "both"
}, },
"content": { "content": {
"bsonType": "string", "bsonType": "string",
"title": "文章内容", "title": "文章内容",
"description": "文章内容", "description": "文章内容",
"label": "文章内容", "label": "文章内容",
"trim":"right" "trim": "right"
}, },
"excerpt": { "excerpt": {
"bsonType": "string", "bsonType": "string",
"title": "文章摘录", "title": "文章摘录",
"description": "文章摘录", "description": "文章摘录",
"label": "摘要", "label": "摘要",
"trim":"both" "trim": "both"
}, },
"article_status": { "article_status": {
"bsonType": "int", "bsonType": "int",
"title": "文章状态", "title": "文章状态",
"description": "文章状态0 草稿箱 1 已发布", "description": "文章状态0 草稿箱 1 已发布",
"defaultValue": 0, "defaultValue": 0,
"enum": [ "enum": [{
{
"value": 0, "value": 0,
"text": "草稿箱" "text": "草稿箱"
}, },
@ -102,8 +101,7 @@
"bsonType": "int", "bsonType": "int",
"title": "开放评论", "title": "开放评论",
"description": "评论状态0 关闭 1 开放", "description": "评论状态0 关闭 1 开放",
"enum": [ "enum": [{
{
"value": 0, "value": 0,
"text": "关闭" "text": "关闭"
}, },
@ -130,7 +128,7 @@
"title": "封面大图", "title": "封面大图",
"description": "缩略图地址", "description": "缩略图地址",
"label": "封面大图", "label": "封面大图",
"trim":"both" "trim": "both"
}, },
"publish_date": { "publish_date": {
"bsonType": "timestamp", "bsonType": "timestamp",