55 lines
1.7 KiB
JavaScript
55 lines
1.7 KiB
JavaScript
db = db.getSiblingDB('zeus');
|
|
db.createUser(
|
|
{
|
|
user: "root",
|
|
pwd: "LcY221815",
|
|
roles:[ { role: "dbOwner", db: "zeus" }]
|
|
}
|
|
)
|
|
db.role.insertOne(
|
|
{
|
|
_id: "admin",
|
|
name: "管理员"
|
|
}
|
|
);
|
|
|
|
db.group.insertOne(
|
|
{
|
|
_id: "1",
|
|
name: "管理员"
|
|
}
|
|
);
|
|
|
|
db.user.insertOne({
|
|
name: "admin",
|
|
password: "1f22f6ce6e58a7326c5b5dd197973105",
|
|
realName: "管理员",
|
|
phone: "18654551561",
|
|
role: "admin",
|
|
group: "1",
|
|
avalible: true,
|
|
_class: "com.synebula.zeus.domain.model.rbac.User"
|
|
});
|
|
|
|
db.system.insertOne({
|
|
_id: "1",
|
|
name: "web",
|
|
uri: "",
|
|
order: 1,
|
|
})
|
|
|
|
db.page.insertMany([
|
|
{ "_id": "1", "name": "groups", "uri": "/groups", "parent": "0", "system": "1", "order": 1, "icon": "group" },
|
|
{ "_id": "2", "name": "roles", "uri": "/roles", "parent": "0", "system": "1", "order": 2, "icon": "manual" },
|
|
{ "_id": "3", "name": "users", "uri": "/users", "parent": "0", "system": "1", "order": 3, "icon": "user" },
|
|
{ "_id": "4", "name": "pages", "uri": "/pages", "parent": "0", "system": "1", "order": 4, "icon": "page" }})
|
|
])
|
|
|
|
db.authority.insertMany([
|
|
{ "role": "admin", "resource": "1", "type": "System", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
{ "role": "admin", "resource": "1", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
{ "role": "admin", "resource": "2", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
{ "role": "admin", "resource": "67595cfcbbef24782f95a325", "type": "Page", "authority": "Allow", "avalible": true, "_class": "com.synebula.zeus.domain.model.rbac.Authority" },
|
|
])
|
|
|