mirror of
https://gitee.com/dcloud/opendb.git
synced 2024-12-27 15:01:15 +08:00
49 lines
1.0 KiB
JSON
49 lines
1.0 KiB
JSON
{
|
||
"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": []
|
||
}
|