opendb/collection/opendb-notice-comment/collection.json

49 lines
1.0 KiB
JSON
Raw Permalink Normal View History

2023-10-23 20:43:45 +08:00
{
"schema": {
"bsonType": "object",
"required": ["notice_id"],
"permission": {
"read": "doc.state == 1 || auth.uid == doc.user_id",
"create": "auth.uid != null",
"update": false,
"delete": "auth.uid == doc.user_id"
},
"properties": {
"_id": {
"description": "ID系统自动生成"
},
"notice_id": {
"description": "通知的id",
"foreignKey": "opendb-notice._id"
},
"text": {
"bsonType": "string"
},
"user_id": {
"forceDefaultValue": {
"$env": "uid"
},
"foreignKey": "uni-id-users._id"
},
"ip": {
"forceDefaultValue": {
"$env": "clientIP"
}
},
"create_time": {
"forceDefaultValue": {
"$env": "now"
}
},
"state": {
"bsonType": "int",
"defaultValue": 0,
"permission": {
"write": "'AUDITOR' in auth.role"
}
}
}
},
"index": []
}