mqtt
2017-02-23 17:08:00 +08:00
看了别人的评论, 只能帮你到这里了。
```
// 部门
departments {
id,
name,
parent_id, // reference departments(`id`)
leader_id, // reference employees(`id`)
}
// 员工
employees {
id,
name,
age,
gender,
...
department_id, // reference departments(`id`)
}
// 资源
resources {
id,
name
}
// 权限
permissions {
resource_id, // reference resources(`id`)
action
}
// 部门权限
department_permission {
department_id, // reference departments(`id`)
permission_id // reference permissions(`id`)
}
// 员工权限
employee_permission {
employee_id, // reference employees(`id`)
permission_id // reference permissions(`id`)
}
```