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

This commit is contained in:
handongxun 2021-09-13 15:46:35 +08:00
parent 0256296464
commit 2ed60492cf

View File

@ -3,10 +3,10 @@
"bsonType": "object", "bsonType": "object",
"required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id", "reply_comment_id"], "required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id", "reply_comment_id"],
"permission": { "permission": {
"read": true, "read": true,
"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": {
@ -15,21 +15,21 @@
"article_id": { "article_id": {
"bsonType": "string", "bsonType": "string",
"description": "文章IDopendb-news-posts 表中的`_id`字段", "description": "文章IDopendb-news-posts 表中的`_id`字段",
"foreignKey":"opendb-news-articles._id" "foreignKey": "opendb-news-articles._id"
}, },
"user_id": { "user_id": {
"bsonType": "string", "bsonType": "string",
"description": "评论者ID参考`uni-id-users` 表", "description": "评论者ID参考`uni-id-users` 表",
"forceDefaultValue": { "forceDefaultValue": {
"$env": "uid" "$env": "uid"
}, },
"foreignKey":"uni-id-users._id" "foreignKey": "uni-id-users._id"
}, },
"comment_content": { "comment_content": {
"bsonType": "string", "bsonType": "string",
"description": "评论内容", "description": "评论内容",
"title": "评论内容", "title": "评论内容",
"trim":"right" "trim": "right"
}, },
"like_count": { "like_count": {
"bsonType": "int", "bsonType": "int",
@ -42,12 +42,12 @@
"reply_user_id": { "reply_user_id": {
"bsonType": "string", "bsonType": "string",
"description": "被回复的评论用户IDcomment_type为1时有效", "description": "被回复的评论用户IDcomment_type为1时有效",
"foreignKey":"uni-id-users._id" "foreignKey": "uni-id-users._id"
}, },
"reply_comment_id": { "reply_comment_id": {
"bsonType": "string", "bsonType": "string",
"description": "被回复的评论IDcomment_type为1时有效", "description": "被回复的评论IDcomment_type为1时有效",
"foreignKey":"opendb-news-comments._id" "foreignKey": "opendb-news-comments._id"
}, },
"comment_date": { "comment_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
@ -66,26 +66,25 @@
} }
}, },
"data": [], "data": [],
"index": [ "index": [{
{ "IndexName": "article_id_",
"IndexName": "article_id_", "MgoKeySchema": {
"MgoKeySchema": { "MgoIndexKeys": [{
"MgoIndexKeys": [{ "Name": "article_id",
"Name": "article_id", "Direction": "1"
"Direction": "1" }],
}], "MgoIsUnique": false
"MgoIsUnique": false }
} },
}, {
{ "IndexName": "user_id_",
"IndexName": "user_id_", "MgoKeySchema": {
"MgoKeySchema": { "MgoIndexKeys": [{
"MgoIndexKeys": [{ "Name": "user_id",
"Name": "user_id", "Direction": "1"
"Direction": "1" }],
}], "MgoIsUnique": false
"MgoIsUnique": false }
} }
}
] ]
} }