Smartbi big data solution: large group user BI system permission design plan

1. Background requirements

某连锁酒店集团使用.NET开发了一套报表分析平台,随着管理及业务发展的需要,原平台开发报表的难度较大、易用性低和数据权限管理较弱,现管理层级上需增加大区总监角色及其它数据权限控制,原平台权限体系修改工作量巨大,为了增强报表分析平台的易维护性和易开发性,集团高层决定废弃原系统,引入Smartbi作为其报表分析平台。
其中,权限管理想要达到的效果是酒店经理、店长、大区总监、经营总监和集团总部人员等不同角色的人员看到不同的数据和报表。

2. Permission design

Smartbi 具有非常完善的安全管理体系,它可以控制用户操作功能权限、数据访问权限、资源访问权限。支持按用户、用户组、角色进行管理;支持多套应用系统共用同一套用户管理系统;支持多级用户管理体系。权限控制的粒度非常细,最小可控制到报表按钮,数据字段等权限。
不同人员查看不同的报表和数据对应的是Smartbi系统中的资源权限和数据权限控制,所以使用Smartbi进行开发和管理是非常容易实现的。

New user

Smartbi big data solution: large group user BI system permission design plan

New role

Smartbi big data solution: large group user BI system permission design plan

Authorize the role to the corresponding user, the correspondence is as follows

Smartbi big data solution: large group user BI system permission design plan

2.1. Resource permissions

Edit the branch role and open the resource authorization management page:

Smartbi big data solution: large group user BI system permission design plan

Authorize the F_ branch report to the branch role:

Smartbi big data solution: large group user BI system permission design plan

After using the store manager user to log in to the Smartbi system, the store manager will obtain the permission of the branch role. The effect is as follows. The store manager can only see the authorized F_ branch report

Smartbi big data solution: large group user BI system permission design plan

Similar to the role of regional director of editor and group management role, the effect after authorization is as follows:
the role of regional director, you can see more reports than branch roles

Smartbi big data solution: large group user BI system permission design plan

Group management role, can see the most reports

Smartbi big data solution: large group user BI system permission design plan

2.2. Data permissions

以其中一个报表为例,有以下5个参数:分店类型,区域,省份,城市,分店,参数之间相互关联,分店的值由前4个参数决定,城市的值由前3个参数决定,省份的值由前2个参数决定,区域的值由分店类型决定。

Smartbi big data solution: large group user BI system permission design plan

1. Store_info

Smartbi big data solution: large group user BI system permission design plan

2. Establish user and branch authority control table User_store:

Smartbi big data solution: large group user BI system permission design plan

3. Establish user attributes The
function of the system's own function CurrentUserName is to obtain the name of the currently logged-in user.
The function of the new user attribute is to obtain the data of which hotels the current user can view when the user logs in

Smartbi big data solution: large group user BI system permission design plan

4. Establish parameters from the authorization control table User_store and user branch attributes
a) The branch type parameters are determined by the user branch attributes

Smartbi big data solution: large group user BI system permission design plan

b) The regional parameters are determined by the user's branch attributes and branch type parameters

Smartbi big data solution: large group user BI system permission design plan

c) The province parameter is determined by the user's branch attributes, branch type and regional parameters

Smartbi big data solution: large group user BI system permission design plan

d) The city parameters are determined by the user's branch attributes, branch type, region and province parameters

Smartbi big data solution: large group user BI system permission design plan

e) The branch parameters are determined by the user's branch attributes, branch type, region, province and city

Smartbi big data solution: large group user BI system permission design plan

3. Actual effect of the case

实际用户:分店角色用户4000人、总监角色用户200人和集团管理角色用户15人,只需简单操作授权即完成权限管理。除此之外,用户还可随意根据自身需求增加角色,如按部门管理,极大的增加了权限管理的自由度和可扩展性。
店长用户登录后的效果如下,只能查看到北京大成店的数据。

Smartbi big data solution: large group user BI system permission design plan

大区总监用户登录后的效果如下,只能查看到深圳宝安新安地铁站店,深圳东门湖贝地铁站店和深圳蛇口工业七路四海公园店这3个酒店的数据。

Smartbi big data solution: large group user BI system permission design plan

最终集团总部人员登录后的效果如下,可以查看6家已经授权的酒店数据。

Smartbi big data solution: large group user BI system permission design plan

4. Smartbi permission system

Smartbi 具有完善的安全管理体系,它可以控制用户功能权限、数据访问权限、资源访问权限。支持按用户、用户组、角色进行管理;支持多套应用系统共用同一套用户管理系统;支持多级用户管理体系。权限分类如下。

Smartbi big data solution: large group user BI system permission design plan

操作权限主要是从更高层面对用户权限进行划分,决定被授权用户可以使用系统的哪些功能,可以执行哪些操作。如:管理员可以查看并设置数据源、用户等信息,普通用户只有查看报表的权限,IT人员有设计和开发报表的权限等等;其原理是在生成sql语句时添加响应的过滤条件,对于各类资源设置数据权限,应该是对其依赖的资源进行设置,比如组合分析如来源于业务主题,则应该对其业务主题进行数据权限设置。
资源权限是对平台具体资源的控制,可以限制被授权用户到具体的某一张报表或某一个图形资源,如:创建的某张报表只允许本部门的所有人查看,本部门以外的人不允许看到;或者某些报表只能被被领导查看,普通员工不允许查看等等。
在系统中,我们可以利用数据权限功能实现不同区域的用户登录 Smartbi 后只能看到其所属区域及子区域的数据,如:北京分行和广州分行只能看到本分行自己的数据,而总行可以看到所有分行的数据和总行数据等等。

Relatedly, these permissions are granted to roles, users, and user groups. The relationship is as follows:

Smartbi big data solution: large group user BI system permission design plan

 用户为最终的授权者,所有的权限最终会体现在用户身上;授权对象之间存在着一定关系,从用户角度分析看,一个用户可以有多个角色,可以同时属于多个用户组,并且一个用户组也可以有多个角色,如此角色和用户组的权限最终都将传递到用户上面。

Guess you like

Origin blog.51cto.com/15047075/2608004