In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Big data report how to control data permissions through parameters, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
In the process of report development, we often encounter the need to control the data rights of the report.
Different organizations, roles, or specific people see different data when they access the same report. For example, the payroll (which is also a simple report), because most companies' salaries are confidential, it is obvious that different people in the system can not see the same results. For example, regional sales statistics, regional sales managers can only see the data of the region, and so on.
In the practical application environment, this kind of problem is generally solved by directly filtering out the data to draw the report template in SQL, and then accessing the specified template according to the login object. However, if there are a large number of users, you need to make more than N reports with the same style but slightly different SQL (report dataset), which is heavy workload and is not conducive to later maintenance.
At this time, we can dynamically receive the personnel account number and other information parameters from the system through the parameters of the report tool, and then dynamically display the data in the report, in order to achieve the purpose of data access control.
Let's take a look at how the report implements data access control through parameters.
Example 1. Data access Control of wage report in personnel Management system
Features: after each person or user logs in, they can only view their own data information. This kind of data table is generally directly or indirectly related to the database user table. SQL can directly use the user number to accurately obtain the data.
Premise:
The report data comes from the data table payroll
User ID (uID) has been obtained from the system session and stored in the variable userID (for specific settings, please refer to how external parameters (such as Url) are passed to the drying report)
Report focus settings:
a. Dataset statement setting
b. Report parameter settings
Summary:
This kind of data permission control is basically for a single record operation, the SQL statement part does not need to do too many other settings, if there are other filter conditions can be added according to the normal parameter settings.
Example 2. Personnel level class data access control
Features: the higher the level of personnel, the more data you see.
Premise:
1. The data required for report rendering is stored in the data table m_datas
two。 The role number (role) has been obtained from the system session and stored in the variable role (for specific settings, please refer to how external parameters (such as Url) are passed to the drying report)
Report focus settings:
a. Dataset statement setting
Note: ${pri} is the use of the dynamic parameter ${parameter name}. It can be regarded as a placeholder and will be replaced by its calculation result during the operation.
b. Parameter setting
Where:
Role is a normal parameter used to receive the currently logged-in user role of the system.
Pri is a dynamic parameter to dynamically generate sql filter conditions according to role
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.