Data rights design
Objective
In a variety of systems. To ensure the security of data objects and easy to operate, so that the enterprise's business units, functional departments can easily and efficiently work together, then a good data rights management design becomes a key issue. Although the workflow of each unit in an enterprise is different, the data objects processed are different, but there are many same places in the organization structure and the way information is handled. This provides an abstract basis for the design of permission controls for data objects. The control of data permissions differs from the control of general functional permissions. The General function permission refers to a user, a role, or a user group can operate a certain function.
The data permission refers to a user, role or a user group of a data object operation amplitude problem, for example, user A can control the data object, and User B only can browse the data object permissions, the same time the data rights control belongs to the category of dynamic permission control.
Data rights design
In the current many applications will be related to the rights management, the permissions are mainly divided into functional permissions and data permissions, as to the relatively simple function of the rights, there are a lot of implementation of the network, there is no longer introduced, below the main discussion of the design of data rights.
Data permissions differ greatly from functional permissions. The particle size is very small. Throughout the development cycle of the project, it cannot be appended as a function permission at the end of the project, and some companies have their own permission components (functional permissions), and the assigned permissions component for the completed project takes effect. Data permissions do not reach the component level and must be planned at the project design stage. Before looking at the same online people want to be based on the principle of spring section to achieve data permissions, so that can do low intrusion, low coupling, the idea is very good, but the reality is very bony. Doing so makes the entire application system more efficient and less discounted. The same control strategy for data permissions is also very inflexible.
Put forward your own design plan below. In the system, a data rights module, the module can be based on the current business module SQL, current operator information, the current permissions of the policy to proactively generate corresponding SQL statements with data rights to the business module to continue processing, for example, as seen:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbgl1mjuxodkwmzq3/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Data Rights Design Analysis
SQL statements can be extended
Data permissions are often used as high-level behaviors for functional permissions. The ability to control the amplitude of a data object. For example, users can only see their orders, ordinary members do not see the advanced properties of a data Object (field) and so on. It is obviously impossible to process the result set in such a fine particle size. At this point only can intervene in the SQL statement, at this time do not want to let developers in the development phase too much consideration of data permissions, it is better to refer to a SQL statement in a configuration file, or database. The development phase requires only the developer to invoke the SQL statement of the data permission control through the interface of the database permission module. This also calculates the low intrusion of the code.
SQL statement efficient parsing processing
One of the core of the data rights module is the efficient parsing of SQL statements, SQL processing refers to the current login information and data rights policy to generate a data permission to process the results of SQL statements, so here the resolution of SQL statements must require accurate and accurate. During the development phase, SQL is written to the configuration file by the developer, and the SQL is processed by data permissions during the execution phase (plus data permissions). This completes the SQL assembly process.
Data Rights policy Design
The most important place is the design of the data rights policy, which introduces several concepts first:
1, Resources: Data rights control objects, business system of various resources. For example, order documents, sales orders, etc.
2. Subject: User, Department, role, etc.
3. Rules: Conditional rules for "Data permissions"
Here the side re-analysis of the subject and rules, the subject has a hierarchical relationship. Ability to set different rules for different principals. For example, the current data is valid only for the creator (or someone), and the permissions for the subordinate principal are the same as for the parent principal (configurable. If checked), the non-current subject can only see part of the data (part of the data is optional). Here are just a few examples of the rules that need to be present in the real world, depending on the enterprise environment or the project environment.
Data Rights policy optimization
Data permissions within the same category of terms of reference, each access permission request is validated. Therefore, an efficient authoritative authentication will be required, and then the algorithm can be written or memcache in order to improve the response speed.
JAVA Data Rights Design