Use the fine_username Parameter to Assign Permissions

  • Last update:  2022-07-20
  • Ⅰ. Overview

    1. Application Scenario

    For many enterprises, sometimes in some data tables, employees of different departments and positions can only see the data of their own departments.

    In addition to the implementation of the multi-level permission requirements introduced earlier, this scenario can also be implemented by adding the FineBI system parameter " fine_username ".

    2. Function introduction

    The parameter " fine_username " is a built-in parameter of FineBI , which can automatically obtain the login name of the login user of the current platform.

    ·       fine_username parameter is analyzed on the dashboard, operations such as filtering component parameter binding (special parameters are hidden by default) cannot be performed on it .

    ·       The parameter usage introduced in this article requires the use of " real-time data ", which can only be used by the data table directly connected to the database.

    ·       FineBI5.1 currently only supports the "system username" parameter, for example: $ fine_username .

    Ⅱ. Example

    example takes the " aaa_user " user information table under the " FRDemo " data built in FineBI as an example, and uses the " fine_username " system parameter.

    1. Create a new server dataset

    The administrator logs in to the data decision system, and clicks "Manage > Data Connection > Server Dataset" to create a new SQL data set.

    2022-07-20_17-03-19.png

    The dataset name is "User Information Table", select the data source as " FRDemo", add the SQL statement "select * from aaa_user ", and click "Save", as shown in the following figure:

    2022-07-20_17-06-44.png

    2. Import users

    The administrator logs in to the data decision system and clicks "Manage> User".

    Click "Import User", select the server dataset created in the previous section , the specific settings are shown in the following figure, click "OK", as shown in the following figure:

    2022-07-20_17-09-10.png

    3. Set User Type

    The administrator logs in to the data decision system, clicks "Manage > User", and clicks "Platform User".

    Add all the users imported in the previous section as "PC User". If users have editing and viewing permissions, add all users to "BI Data Processing User", as shown in the following figure:

    2022-07-20_12-19-50.png

    4. Create SQL dataset

    The administrator logs in to the data decision system, clicks "Data Preparation", and switches the data list to "Direct Data". Create a new "User Information" business package and enter it, select "Add SQL Data Set".

    The table name is "User Information Table", the SQL statement is "select * from aaa_user where account='${ fine_username }'", get the parameters of fine_username , and click"OK", as shown in the following figure:

    Note 1: Only real-time data is supported, and extracted data is not supported.

    Note 2: Parameters cannot be written in the select field part of SQL, for example: select account as '${ fine_username }' , password, organization, title from aaa_user . It can only be written in the filter condition, BI does not support dynamic selection of fields.

    Note 3: When the administrator views this table, the data is empty, because there is no administrator information in the user table.

    2022-07-20_17-14-58.png

    2022-07-20_17-17-01.png

    5. Assign data usage rights

    The administrator logs in to the data decision system, clicks "Manage > Permission> General permission Configuration", and selects "All Departments".

    Click "Data Authorization", select "Direct Data", and assign the "Use" permission of "User Information Table" in the real-time data to all departments, as shown in the following figure:

    Pa

    6. Effect View

    Note: Administrators cannot see any data in this table. Because the filter condition of the SQL statement is "where account='${ fine_username }'", since there is no administrator information in the user table, the administrator cannot actually see any data in the table.

    22 Department user 99 Log in to the data decision system, click "Data Preparation > Package> User Information Table", and can only view their own information. As shown below:

    2022-07-20_17-24-09.png

    26 Department users 98 Log in to the data decision-making system, click "Data Preparation > Package> User Information Table", and can only view their own information. As shown below:

     2022-07-20_17-25-25.png

    附件列表


    主题: System Management
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy