Skip to content

Commit

Permalink
fix: 完善 admin rules 中删除相关表的规则
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Jun 25, 2021
1 parent 11f2988 commit 83e8818
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 205 deletions.
36 changes: 33 additions & 3 deletions init/rules/admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@
"read": "$has('permission.read')",
"update": "$has('permission.edit')",
"add": "$has('permission.create')",
"remove": "$has('permission.delete')",
"remove": {
"condition": "$has('permission.delete')",
"query": {
"name": {
"required": true,
"notExists": "/roles/permissions"
}
}
},
"count": "$has('permission.read')"
},
"roles": {
"read": "$has('role.read')",
"update": "$has('role.edit')",
"add": "$has('role.create')",
"remove": "$has('role.delete')"
"remove": {
"condition": "$has('role.delete')",
"query": {
"name": {
"required": true,
"notExists": "/admins/roles"
}
}
}
},
"rules": {
"read": "$has('rule.read')",
Expand All @@ -28,7 +44,21 @@
"read": "$has('function.read')",
"update": "$has('function.edit')",
"add": "$has('function.create')",
"remove": "$has('function.delete')",
"remove": {
"condition": "$has('function.delete')",
"query": {
"_id": {
"notExists": "/triggers/func_id"
},
"status": {
"required": true,
"default": 0,
"in": [
0
]
}
}
},
"count": "$has('function.read')"
},
"function_logs": {
Expand Down
Loading

0 comments on commit 83e8818

Please sign in to comment.