add permission config

This commit is contained in:
崔红保 2020-10-27 14:45:23 +08:00 committed by Gitee
parent ff525c69e4
commit 862185f559

View File

@ -2,6 +2,12 @@
"schema": { "schema": {
"bsonType": "object", "bsonType": "object",
"required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence", "comment_status", "comment_count","mode"], "required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence", "comment_status", "comment_count","mode"],
"permission": {
".read": true,
".create": "auth.uid != null",
".update": "doc.uid == auth.uid",
".delete": "doc.uid == auth.uid"
},
"properties": { "properties": {
"_id": { "_id": {
"description": "存储文档 ID用户 ID系统自动生成" "description": "存储文档 ID用户 ID系统自动生成"
@ -37,19 +43,31 @@
}, },
"view_count": { "view_count": {
"bsonType": "int", "bsonType": "int",
"description": "阅读数量" "description": "阅读数量",
"permission": {
".write": false
}
}, },
"like_count": { "like_count": {
"bsonType": "int", "bsonType": "int",
"description": "喜欢数、点赞数" "description": "喜欢数、点赞数",
"permission": {
".write": false
}
}, },
"is_sticky": { "is_sticky": {
"bsonType": "bool", "bsonType": "bool",
"description": "是否置顶" "description": "是否置顶",
"permission": {
".write": false
}
}, },
"is_essence": { "is_essence": {
"bsonType": "bool", "bsonType": "bool",
"description": "阅读加精" "description": "阅读加精",
"permission": {
".write": false
}
}, },
"comment_status": { "comment_status": {
"bsonType": "int", "bsonType": "int",
@ -59,7 +77,10 @@
}, },
"comment_count": { "comment_count": {
"bsonType": "int", "bsonType": "int",
"description": "评论数量" "description": "评论数量",
"permission": {
".write": false
}
}, },
"last_comment_user_id": { "last_comment_user_id": {
"bsonType": "string", "bsonType": "string",
@ -72,11 +93,17 @@
}, },
"publish_date": { "publish_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "发表时间" "description": "发表时间",
"defaultValue": {
"$env": "now"
}
}, },
"publish_ip": { "publish_ip": {
"bsonType": "string", "bsonType": "string",
"description": "发表时 IP 地址" "description": "发表时 IP 地址",
"forceDefaultValue": {
"$env": "clientIP"
}
}, },
"last_modify_date": { "last_modify_date": {
"bsonType": "timestamp", "bsonType": "timestamp",