10.5角色管理
-
创建自定义角色:
-
db.createRole({role:"onlyReadForCustomers", privileges:[{resource:{db:"crm",collection:"customers"}, actions:["find"]}], roles:[]})
-
-
删除自定义角色:
-
db.dropRole(“onlyReadForCustomers”)
-
db.dropAllRoles()
-
创建自定义角色:
db.createRole({role:"onlyReadForCustomers",
privileges:[{resource:{db:"crm",collection:"customers"},
actions:["find"]}], roles:[]})
删除自定义角色:
db.dropRole(“onlyReadForCustomers”)
db.dropAllRoles()