页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

1.说明

      不使用 Smartbi 系统自身的操作权限验证逻辑,而是由第三方系统进行操作权限验证,给 Smartbi 返回一个用户能否访问指定操作的状态指示。

面板
borderColor#BBBBBB
bgColor#F0F0F0
borderWidth1
borderStylesolid

目录

       

2.实现步骤

1. 在插件包中新建一个Java类com.opauth.takeover.usermanager.FunctionAuthDemo,并且实现接口 smartbi.usermanager.IFunctionAuth。接口定义如下。

 

代码块
languagejava
firstline1
linenumberstrue
package com.mycomp.usermanager;
 
public class TestFunctionAuth implements IFunctionAuth {
    private static TestFunctionAuth auth = new TestFunctionAuth();
    public static TestFunctionAuth getInstance() {
        return auth;
    } 
    private TestFunctionAuth() {
        // TestFunctionAuth
    } 
    public boolean isFuncTypeAccessible(String userId, String functionCode) {
        // 在这里实现用户操作权限判断的逻辑,返回状态 true|false 指明用户能否访问指定操作
        return true;
    }
}

 

2. 修改插件包文件 applicationContext.xml 增加如下内容。

 

代码块
firstline1
linenumberstrue
<bean id="usermanager" class="smartbi.usermanager.UserManagerModule" factory-method="getInstance">
      <property name="functionAuth" ref="FunctionAuthDemo"/>
</bean>
<bean id="FunctionAuthDemo" class="com.opauth.takeover.usermanager.FunctionAuthDemo" factory-method="getInstance"></bean>

 

3.gif演示示例插件包源码请参考:操作权限验证.rar