bg.work rights management to achieve
Rights management system for the importance of a structured Needless to say, there is no limitation of rights management, office systems will not be available to talk about. Honestly rights management system to implement without any threshold, several directly determine if else will be able to solve real needs, but if you need a flexible, robust, maintainable, scalable up to the entire satisfaction of the development team of the rights management system that it is another matter
bg.work rights system and data interface of the system implementation are closely linked, so before introduction permissions system, we must first introduce data and interface features.
1, data manipulation:
In the design of the data layer bg.work Model ORM, the basic structure is as follows:
//model对应数据库的表,基于model orm 实现,model字段可以动态读取,利用这一原则与权限系统结合,可以动态设置针对model数据控制
@Model("department", "部门")
class Department:ContextModel("corp_department",
"public") {
companion object : RefSingleton<Department> {
override lateinit var ref: Department
}
val id= ModelField(null,
"id",
FieldType.BIGINT,
"标示",
primaryKey = FieldPrimaryKey())
val name= ModelField(null,
"name",
FieldType.STRING,
"名称")
val comment = ModelField(null,
"comment",
FieldType.TEXT,
"注释")
}
2, interface definition
<!--基于model orm 框架,界面元素对应Model属性名称,基于这一原则,我们可以结合权限控制系统实现对界面的灵活控制-->
<view type="list">
<field name="id"/>
<field name="name" type="static"/>
<field name="comment" type="static"/>
</view>
The corresponding interface:
3, bg.work framework system permissions
Description:
Access Model Rule Control Model (data table)
read: whether the right to operate, read the field is set, which reads user data, limited to what department, limited to individuals / entire organization, to limit the role of the target, additional conditions
delete: whether the right to operate, which deletes user data, limited to what department, limited to individuals / entire organization, to limit the role of the target, additional conditions
edit: whether the right to operate, update the field is set, which updates the user data, limited to what department, limited to individuals / entire organization, to limit the role of the target, additional conditions
create: whether the right to operate, add fields set
Set interface:
Model UI Rule to limit the Model View
For field operations and limit model view button to show, each model has a corresponding View Type
Setting interface is as follows:
App menu control, but also for management control system menu:
V. Summary
Join bg.work rights system, to join the follow-up function enables direct control, but also to achieve permission issues when you no longer consider joining function, all the permissions are deferred to system deployment or customization phase
Additional:
bg.work source connection: Encourage your thumbs