add permission

This commit is contained in:
崔红保 2020-10-27 18:21:58 +08:00
parent 2c211d4c96
commit fdac3feb1d
5 changed files with 29 additions and 2 deletions

View File

@ -2,6 +2,12 @@
"schema": {
"bsonType": "object",
"required": ["name"],
"permission": {
".read": true,
".create": false,
".update": false,
".delete": false
},
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"

View File

@ -2,6 +2,12 @@
"schema": {
"bsonType": "object",
"required": ["goods_id", "user_id", "content"],
"permission": {
".read": true,
".create": "auth.uid != null",
".update": "doc.user_id == auth.uid",
".delete": "doc.user_id == auth.uid"
},
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"

View File

@ -18,7 +18,10 @@
},
"user_id": {
"bsonType": "string",
"description": "评论者ID参考`uni-id-users` 表"
"description": "评论者ID参考`uni-id-users` 表",
"forceDefaultValue": {
"$env": "uid"
}
},
"comment_content": {
"bsonType": "string",

View File

@ -2,6 +2,12 @@
"schema": {
"bsonType": "object",
"required": ["content", "count"],
"permission": {
".read": true,
".create": false,
".update": false,
".delete": false
},
"properties": {
"_id": {
"description": "ID系统自动生成"

View File

@ -1,7 +1,13 @@
{
"schema": {
"bsonType": "object",
"required": ["user_id", "content"],
"required": ["content"],
"permission": {
".read": false,
".create": false,
".update": false,
".delete": false
},
"properties": {
"_id": {
"description": "ID系统自动生成"