A permission management method, device, apparatus and storage medium

By constructing a route structure tree to uniformly configure permissions under the micro-frontend architecture, the problem of scattered permission configuration in existing technologies is solved, achieving efficient and unified permission management and reducing maintenance costs.

CN115577344BActive Publication Date: 2026-11-03CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110687845.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-21
Publication Date
2026-11-03
Estimated Expiration
2041-06-21

AI Technical Summary

Technical Problem

In existing technologies, the permission configurations of each sub-application in a micro-frontend architecture are scattered in the business code, which requires developers to implement permission logic themselves, increasing maintenance costs and lacking a unified and efficient configuration method.

Method used

By constructing a route structure tree for multiple applications, the permission information of accounts in multiple applications is uniformly configured, and permission judgment is performed on route jump requests based on this tree. Hook scripts are used to automatically update the route information.

Benefits of technology

It enables unified configuration of routing permissions for multiple applications, reducing later maintenance costs and improving the efficiency and consistency of permission configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115577344B_ABST
    Figure CN115577344B_ABST
Patent Text Reader

Abstract

The application discloses a permission management method, which comprises the following steps: acquiring routing information of a plurality of applications and an association relationship of the plurality of applications; according to the association relationship, routing information of the plurality of applications is combined into a routing structure tree; wherein the routing structure tree comprises all routing nodes of the plurality of applications; the routing structure tree is displayed on a permission configuration interface; based on the routing structure tree, permission information of at least one account in the plurality of applications is configured; and according to the permission information of at least one account in the plurality of applications, permission judgment of a routing jump request of an access account is performed. In this way, by constructing a routing structure tree, the routing permission of an account in a plurality of applications is uniformly configured, the permission configuration is more unified and efficient, and the maintenance cost in the later period is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet technology, and in particular to a method, apparatus, device and storage medium for access control. Background Technology

[0002] Micro-frontends are an architecture that has emerged in the last two years, integrating multiple sub-applications into a single main application. With the advent of micro-frontend architectures, a new challenge has arisen: how to uniformly configure routing permissions for multiple sub-applications. Current technologies involve each sub-application configuring its own permissions. In a single-sub-application architecture, routing permissions are written in the business logic code of each sub-application. However, this permission configuration method prevents sub-applications from focusing on business development, still requiring sub-application developers to implement permission logic themselves; furthermore, it lacks a unified and efficient permission configuration method, resulting in various permission logics being scattered across sub-applications, increasing the technical costs of later maintenance. Summary of the Invention

[0003] To address the aforementioned technical problems, embodiments of this application aim to provide a permission management method, apparatus, device, and storage medium.

[0004] The technical solution of this application is implemented as follows:

[0005] Firstly, a permission management method is provided, which includes:

[0006] Obtain routing information for multiple applications, as well as the relationships between these applications;

[0007] Based on the aforementioned associations, the routing information of the multiple applications is organized into a routing structure tree; wherein, the routing structure tree includes all routing nodes of the multiple applications;

[0008] Display the route structure tree in the permission configuration interface;

[0009] Based on the routing structure tree, configure permission information for at least one account in the multiple applications;

[0010] Based on the permission information of at least one account in the multiple applications, the access account is used to determine the permission of the routing request.

[0011] In the above scheme, the routing information of the application includes all routing nodes of the application and the routing hierarchy relationship between all routing nodes; wherein, all routing nodes of a single application include one root routing node and M child routing nodes, where M is an integer greater than or equal to 0;

[0012] In the above scheme, the association relationship includes the application hierarchy relationship between the multiple applications; wherein, the application hierarchy relationship is used to divide the multiple applications into one main application and N sub-applications, where N is an integer greater than or equal to 1.

[0013] In the above scheme, the step of forming a routing structure tree based on the association relationship of the multiple applications includes:

[0014] Based on the application hierarchy, the main application and sub-applications among the multiple applications are determined;

[0015] Based on the routing hierarchy, all routing nodes of the main application are divided into main application root routing nodes and main application sub-routing nodes, and all routing nodes of the sub-application are divided into sub-application root routing nodes and sub-application sub-routing nodes.

[0016] The routing structure tree is obtained by taking the main application root routing node as the first-level routing node, the main application sub-routing node and the sub-application root routing node as the second-level routing nodes, and the sub-application sub-routing node as the third-level routing node.

[0017] In the above scheme, the step of determining the permission of the access account for routing requests based on the permission information of at least one account in the multiple applications includes:

[0018] The main application determines the access permissions of the accessing account by using the permission information of at least one account in the multiple applications for routing redirection requests.

[0019] In the above scheme, configuring permission information for at least one account in the multiple applications based on the routing structure tree includes:

[0020] Select all the routing nodes that the target account has the right to access in the multiple applications on the routing structure tree to obtain the authorized routing nodes of the target account; use the authorized routing nodes as the permission information of the target account; wherein, the target account is any one of the at least one accounts.

[0021] In the above scheme, based on the permission information of at least one account in the multiple applications, the permission judgment for the access account to make a routing request includes:

[0022] Obtain the access account of the accessing user; determine the permission information corresponding to the access account from the permission information of the at least one account in the multiple applications; make a permission judgment on the routing request of the access account based on the permission information corresponding to the access account; if the permission information of the account includes the routing node corresponding to the routing request, then execute the redirect; if the permission information of the account does not include the routing node corresponding to the routing request, then cancel the redirect and display a prompt message.

[0023] In the above scheme, when the routing information of the target application is updated in the multiple applications, the updated routing information submitted by the target application through hook scripts, project scaffolding, or dependency packages is obtained;

[0024] The updated routing information is used as the routing information for the target application.

[0025] Secondly, a permission management device is provided, the device comprising:

[0026] The acquisition module is used to acquire routing information of multiple applications and the association relationship between the multiple applications;

[0027] A building module is used to assemble the routing information of the multiple applications into a routing structure tree based on the association relationship; wherein the routing structure tree includes all routing nodes of the multiple applications;

[0028] The display module is used to display the route structure tree in the permission configuration interface;

[0029] The configuration module is used to configure permission information for at least one account in the multiple applications based on the routing structure tree.

[0030] The processing module is used to determine the permissions of the access account for the routing request based on the permission information of at least one account in the multiple applications.

[0031] Thirdly, a permission management device is provided, the device comprising: a processor and a memory configured to store a computer program capable of running on the processor, wherein the processor is configured to execute the steps of any of the preceding methods when running the computer program.

[0032] Fourthly, a computer storage medium is provided that stores a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the aforementioned method.

[0033] This application discloses a permission management method, which includes: obtaining routing information of multiple applications and the association relationships between the multiple applications; forming a routing structure tree based on the association relationships; wherein the routing structure tree includes all routing nodes of the multiple applications; displaying the routing structure tree in a permission configuration interface; configuring permission information for at least one account in the multiple applications based on the routing structure tree; and performing permission judgment on the access account for routing requests based on the permission information of at least one account in the multiple applications. Thus, by constructing a routing structure tree and uniformly configuring the routing permissions of accounts across multiple applications, permission configuration can be made more unified and efficient, effectively reducing later maintenance costs. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the first process of the permission management method in the embodiments of this application;

[0035] Figure 2 This is a schematic diagram of the second process of the permission management method in the embodiments of this application;

[0036] Figure 3 This is a schematic diagram of the micro-frontend architecture in the embodiments of this application;

[0037] Figure 4 This is a graphical representation of the routing structure tree in an embodiment of this application;

[0038] Figure 5 (a) is a schematic diagram of the account or role selection box in an embodiment of this application;

[0039] Figure 5 (b) is a schematic diagram of the role radio button in the embodiments of this application;

[0040] Figure 6 This is a schematic diagram of the third process of the permission management method in the embodiments of this application;

[0041] Figure 7 This application provides a method for submitting routing information via hook scripts, project scaffolding, or dependency packages.

[0042] Figure 8 This is a schematic diagram of the permission configuration interface in an embodiment of this application;

[0043] Figure 9 This is a schematic diagram of the device for implementing the permission management method in the embodiments of this application;

[0044] Figure 10 This is a schematic diagram of the composition structure of the access control device in the embodiments of this application;

[0045] Figure 11This is a schematic diagram of the composition structure of the access control device in the embodiments of this application. Detailed Implementation

[0046] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0047] Front-end development, or web page development, is characterized by the separation of front-end and back-end in modern front-end frameworks, with the front-end handling page routing. As business scales, the package size of individual front-end applications increases, and the build time becomes longer, leading to a need to integrate multiple applications into a single main application. Micro-frontends, an architecture that has emerged in the last two years, integrate multiple sub-applications into a single main application. With the advent of micro-frontend architecture, how to uniformly configure front-end routing permissions for multiple sub-applications has become a new challenge. This application proposes a permission management method, apparatus, device, and storage medium that can achieve unified configuration of routing permissions for multiple applications.

[0048] Figure 1 This is a schematic diagram of the first process of the permission management method in the embodiments of this application, such as... Figure 1 As shown, specific methods for access control may include:

[0049] Step 101: Obtain routing information for multiple applications, as well as the relationships between these applications.

[0050] Here, the application's routing information is used to represent all routing nodes within a single application. Each routing node corresponds to a page path. When a page navigates from one routing node to another, it's called a route jump. Permissions can be configured by setting which routing nodes an account has access to. Different route names can also be set for different routing nodes for easy identification.

[0051] By obtaining routing information from multiple applications, a foundation can be provided for configuring permissions for each application. This permission configuration can be categorized as route permissions. Route permissions restrict route navigation, specifically limiting page navigation corresponding to a route node.

[0052] In some embodiments, the routing information of the application includes all routing nodes of the application and the routing hierarchy relationship between all routing nodes; wherein, all routing nodes of a single application include a root routing node and M child routing nodes, where M is an integer greater than or equal to 0.

[0053] Here, the routing hierarchy among all routing nodes can be obtained based on the hierarchy among the page paths corresponding to the routing nodes. For example, based on the routing hierarchy among the routing nodes, all routing nodes of a single application can be divided into a root routing node and child routing nodes. Specifically, all routing nodes of a single application include one root routing node and M child routing nodes, where M is an integer greater than or equal to 0.

[0054] By differentiating routing nodes into hierarchical levels, the required routing node can be quickly located based on the routing hierarchy among the routing nodes.

[0055] Here, the association relationship is used to represent the relationship information between applications. Multiple applications can exist within a single page module, and these applications can be related to each other. For example, in a micro-frontend system, multiple applications can be integrated into one application.

[0056] In some embodiments, the association relationship includes the application hierarchy relationship among the plurality of applications; wherein, the application hierarchy relationship is used to divide the plurality of applications into one main application and N sub-applications, where N is an integer greater than or equal to 1.

[0057] By obtaining the application hierarchy relationship between multiple applications, the application that needs to be selected can be quickly found when configuring permissions.

[0058] Step 102: Based on the association relationship, the routing information of the multiple applications is organized into a routing structure tree; wherein the routing structure tree includes all routing nodes of the multiple applications.

[0059] The route structure tree here is used to systematically represent all route nodes under the multiple applications. By systematically integrating all route nodes under all applications, the required route nodes can be quickly found and selected when configuring route permissions.

[0060] Step 103: Display the route structure tree in the permission configuration interface.

[0061] Here, the permission configuration interface is used to visually display the route structure tree, allowing permission configuration personnel to directly configure permissions for target accounts across multiple applications based on the route structure tree. In some implementations, the route structure tree can be displayed graphically on the permission configuration interface, intuitively showing all route nodes, facilitating configuration operations for permission configuration personnel.

[0062] Step 104: Based on the routing structure tree, configure permission information for at least one account in the multiple applications.

[0063] Here, permission information is used to characterize the routing permissions of an account across multiple applications. Permission configuration personnel can configure permissions for at least one account based on the routing structure tree, enabling unified configuration of account permissions across multiple applications, instead of configuring permissions for each account separately in each application, effectively reducing later maintenance costs.

[0064] In some embodiments, configuring permission information for at least one account in the multiple applications based on the routing structure tree includes:

[0065] Select all the routing nodes that the target account has the right to access in the multiple applications on the routing structure tree to obtain the authorized routing nodes of the target account; use the authorized routing nodes as the permission information of the target account; wherein, the target account is any one of the at least one accounts.

[0066] Here, by using the authorized routing nodes of the target account as the permission information of the target account, the permission of the account's routing request can be directly judged based on whether the routing node corresponding to the account's redirection request is an authorized routing node of that account.

[0067] Step 105: Based on the permission information of at least one account in the multiple applications, determine the permission of the access account for the routing request.

[0068] Here, a route redirection request is a request to redirect to the target route node. When an access account logs in, the access account's permission information can be used to determine the permissions of the route redirection request, and then the decision structure can be used to determine whether to execute the route redirection request.

[0069] Here, the executing entity for steps 101 to 105 can be the processor of the access control device.

[0070] The technical solution of this application constructs a route structure tree including all route nodes by using routing information and relationships between multiple applications. Based on this route structure tree, it implements unified configuration of routing permissions for an account across multiple applications and performs permission checks on route redirection requests based on the configured permissions. Thus, by constructing a route structure tree and uniformly configuring routing permissions for an account across multiple applications, permission configuration becomes more unified and efficient, effectively reducing later maintenance costs.

[0071] To better illustrate the purpose of this application, further examples are provided based on the embodiments described above. Figure 2 This is a schematic diagram of the second process of the permission management method in an embodiment of this application. For example... Figure 2 As shown, the specific methods for access control include:

[0072] Step 201: Obtain routing information for multiple applications and the relationships between the multiple applications; wherein, the routing information of the applications includes all routing nodes of the applications and the routing hierarchy relationships between all routing nodes, and the relationships include the application hierarchy relationships between the multiple applications.

[0073] The routing information of the application includes all routing nodes of the application and the routing hierarchy between all routing nodes; wherein, all routing nodes of a single application include one root routing node and M child routing nodes, where M is an integer greater than or equal to 0.

[0074] Each route node contains at least two pieces of information: the page path and a route name for easy identification. Route information can be a tree-like data structure, represented in JSON or XML format.

[0075] The association relationship includes the application hierarchy relationship between the multiple applications; wherein, the application hierarchy relationship is used to divide the multiple applications into one main application and N sub-applications, where N is an integer greater than or equal to 1.

[0076] In some embodiments, obtaining routing information for multiple applications includes obtaining routing information submitted by multiple applications through hook scripts, project scaffolding, or dependency packages.

[0077] In some embodiments, the method further includes: when the routing information of the target application in the plurality of applications is updated, obtaining the updated routing information submitted by the target application through a hook script, project scaffolding, or dependency package; and using the updated routing information as the routing information of the target application.

[0078] In some embodiments, routing information can also be submitted during code version updates to ensure that the obtained routing information is the latest available. Applications can submit routing information during code version updates using scripts, front-end dependencies, or front-end scaffolding that integrates these dependencies, which automatically read the routing information for individual applications.

[0079] Step 202: Based on the application hierarchy, determine the main application and sub-applications among the multiple applications.

[0080] A single page module can contain multiple applications, and these applications can be related to each other. For example, in a micro-frontend system, multiple applications can be integrated into a single application. Figure 3 A schematic diagram of a micro-frontend architecture is shown, which integrates two sub-applications under a main application, namely sub-application 1 and sub-application 2, and each sub-application includes 3 components.

[0081] Step 203: Based on the routing hierarchy, divide all routing nodes of the main application into main application root routing nodes and main application sub-routing nodes, and divide all routing nodes of the sub-application into sub-application root routing nodes and sub-application sub-routing nodes.

[0082] Step 204: Use the main application root routing node as the first-level routing node, the main application sub-routing node and the sub-application root routing node as the second-level routing nodes, and the sub-application sub-routing node as the third-level routing node to obtain the routing structure tree.

[0083] By displaying the route nodes of the main application and sub-applications in the route structure tree through the routing hierarchy and application hierarchy, the required route nodes can be quickly located when configuring permissions later.

[0084] For example, Figure 4 This demonstrates a routing structure tree, such as Figure 4 As shown, the node corresponding to the root route of the main application is the first-level routing node, the nodes corresponding to the main application sub-route 1, main application sub-route 2, sub-application 1 root route, and sub-application 2 root route are the second-level routing nodes, and the nodes corresponding to sub-application 1 sub-route 1, sub-application 1 sub-route 2, sub-application 2 sub-route 1, and sub-application 2 sub-route 2 are the third-level routing nodes.

[0085] Step 205: Display the route structure tree in the permission configuration interface.

[0086] Here, the permission configuration interface is used to visually display the route structure tree, allowing permission configuration personnel to directly configure account permissions across multiple applications based on the route structure tree. In some implementations, the route structure tree can be displayed graphically in the permission configuration interface, intuitively showing all route nodes, facilitating configuration operations for permission configuration personnel.

[0087] The graphical route structure tree described above can be displayed in various ways, including but not limited to web pages, Windows client applications, Android client applications, and iOS client applications. In addition to the route structure tree, the display interface also includes account or role selection boxes. Users configuring permissions can select a target account or role in the selection box and then check the route nodes that the target account or role is authorized to access in the route structure tree. The selected authorized route nodes are used as the role's permission information across multiple applications, and the permission information for each account or role is submitted to the server and stored in the database.

[0088] For example, the permission configuration interface can also display Figure 5(a) shows an account or role selection box. It is used to select an account or role. (Besides...) Figure 5 Outside the character frame in (a), you can also... Figure 5 (b) shows the character radio buttons for displaying and selecting characters.

[0089] Step 206: Based on the routing structure tree, configure permission information for at least one account in the multiple applications.

[0090] Here, permission information is used to characterize the routing permissions of an account across multiple applications. Permission configuration personnel can configure permissions for at least one account based on the routing structure tree, enabling unified configuration of account permissions across multiple applications, instead of configuring permissions for each account separately in each application, effectively reducing later maintenance costs.

[0091] In some embodiments, configuring permission information for at least one account in the multiple applications based on the routing structure tree includes: selecting all routing nodes that the target account has the right to access in the multiple applications on the routing structure tree to obtain the authorized routing nodes of the target account; and using the authorized routing nodes as the permission information of the target account; wherein the target account is any one of the at least one accounts.

[0092] Step 207: Based on the permission information of at least one account in the multiple applications, determine the permission of the access account for the routing request.

[0093] In some embodiments, the permission determination of the access account for the routing request based on the permission information of at least one account in the plurality of applications includes:

[0094] Obtain the access account of the accessing user;

[0095] The permission information corresponding to the access account is determined from the permission information of the at least one account in the multiple applications;

[0096] Based on the permission information corresponding to the access account, the permission judgment is made on the routing request of the access account;

[0097] If the account's permission information includes the routing node corresponding to the routing request, then the redirection is executed; if the account's permission information does not include the routing node corresponding to the routing request, then the redirection is canceled and a prompt message is displayed.

[0098] The message here is to inform the user that the account does not have permission to access the routing node corresponding to the redirect request.

[0099] After logging into an account, the permission information corresponding to that account is compared with the routing node corresponding to the routing request. The permission of the account's routing request can be determined directly based on whether the routing node corresponding to the account's routing request is a routing node included in the account's permission information.

[0100] The technical solution of this application divides applications into main applications and sub-applications, and further divides the main application and all its routing nodes into main application root routing nodes and main application sub-routing nodes. By constructing a routing structure tree, the routing structure tree can more intuitively and systematically display all routing nodes under multiple applications, facilitating permission configuration for administrators. This application can uniformly configure the routing permissions of accounts across multiple applications, making permission configuration more unified and efficient, and effectively reducing later maintenance costs.

[0101] To better illustrate the purpose of this application, further examples are provided based on the embodiments described above. Figure 6 This is a schematic diagram of the third process of the permission management method in the embodiments of this application, which is applied to a micro-frontend.

[0102] In this embodiment, the micro-frontend is implemented using the Qiankun framework; both the main and sub-application frontend projects use the Vue framework, with dependencies managed using Webpack; the code management tool is Git, and the hook for submitting route information uses pre-commit, which executes a Node.js script to directly submit the application's route information to the corresponding database; the sub-application's route information and the overall application's route hierarchy are transmitted and saved in JSON format; the graphical configuration system for route permissions is presented as a web page, and the configured service logic is implemented by the main application.

[0103] like Figure 6 As shown, the specific process of the permission management method is as follows:

[0104] Step 601: Obtain routing information submitted by multiple applications via hook scripts, project scaffolding, or dependency packages.

[0105] The application's routing information includes all routing nodes of the application and the routing hierarchy among these nodes. Based on this hierarchy, all routing nodes of a single application can be divided into a root routing node and child routing nodes. Specifically, all routing nodes of a single application include one root routing node and M child routing nodes, where M is an integer greater than or equal to 0.

[0106] Obtaining routing information submitted by multiple applications through hook scripts, project scaffolding, or dependency packages further includes: when the routing information of a target application is updated among the multiple applications, obtaining the updated routing information submitted by the target application through hook scripts, project scaffolding, or dependency packages; and using the updated routing information as the routing information of the target application.

[0107] By obtaining the updated routing information when the target application's routing information is updated, and using this updated routing information as the target application's routing information, the obtained routing information can be made up-to-date. The application can automatically submit the updated routing information when it is updated by using hook scripts, project scaffolding, or dependency packages.

[0108] In some embodiments, routing information can also be submitted during code version updates to ensure that the obtained routing information is the latest available. Applications can submit routing information during code version updates using scripts, front-end dependencies, or front-end scaffolding that integrates these dependencies, which automatically read the routing information for individual applications.

[0109] For example, multiple applications can submit routing information via hook scripts, project scaffolding, or dependency packages using the following methods:

[0110] Integrate a utility dependency package into the codebase of a single application. This dependency package is characterized by submitting the application's routing information to a permission service when the code version is updated, ensuring that the submitted routing information is up-to-date. This permission service can be the current micro-frontend system server or a permission management service independent of the business project. The address parameter of the permission service only needs to be set when the utility dependency package is included. The version update can refer to a single code commit to the repository or a version release.

[0111] If the timing of submitting routing information is during code commit, code management tools include, but are not limited to, Git and SVN. Git and SVN can trigger custom scripts when specific important actions are executed; this mechanism is called a hook. Executing a custom script within a hook that occurs during a code commit or upload action submits the current application's routing information to the specified permission service address.

[0112] For example, Figure 7 This demonstrates a method for an application to submit routing information via hook scripts, project scaffolding, or dependency packages, primarily consisting of steps 701 and 702:

[0113] Step 701: Initialize the application with the project scaffolding and modify the project scaffolding parameters in the application.

[0114] Specifically, a route commit hook script is introduced into all front-end applications of the micro-frontend, setting the address of the permission service to be committed, and setting the script to execute the commit route information during the pre-commit (saving the changed code locally) of the code management tool Git.

[0115] The definition of the hook script .git / hooks / pre-commit is simply to update FeRoutes.js (update routing information) using Node.js.

[0116] Step 702: `git commit` triggers the pre-commit hook, uploading the routing information of the current application.

[0117] Specifically, according to the existing mechanism provided by Git, after defining the .git / hooks / pre-commit script in step 701 above, once the developer executes the git commit command to commit the latest code, the pre-commit hook will be automatically triggered just before the commit.

[0118] The hook executes the updateFeRoutes.js script defined in step 701. After reading the routing information of the current application, the script directly requests the permission database, retrieves the routing information data of the entire micro-frontend application, updates the corresponding routing node of the current application, and saves it back to the database.

[0119] Step 602: Obtain the application hierarchy relationship between multiple applications under the current micro-frontend architecture, and divide the multiple applications into main applications and sub-applications.

[0120] The multiple applications include one main application and N sub-applications, where N is an integer greater than or equal to 1. Multiple applications can exist within a single page module, and these applications can be related to each other. For example, in a micro-frontend system, multiple applications can be integrated into a single application. Figure 3 A schematic diagram of a micro-frontend architecture is shown, which integrates two sub-applications under a main application, namely sub-application 1 and sub-application 2, and each sub-application includes 3 components.

[0121] Step 603: Based on the routing hierarchy, divide all routing nodes of the main application into main application root routing nodes and main application sub-routing nodes, and divide all routing nodes of the sub-application into sub-application root routing nodes and sub-application sub-routing nodes.

[0122] Step 604: Use the main application root routing node as the first-layer routing node, the main application sub-routing node and the sub-application root routing node as the second-layer routing nodes, and the sub-application sub-routing node as the third-layer routing node to obtain the routing structure tree.

[0123] By displaying the route nodes of the main application and sub-applications in the route structure tree through the routing hierarchy and application hierarchy, the required route nodes can be quickly located when configuring permissions later.

[0124] Step 605: Display the route structure tree in a graphical form on the permission configuration interface.

[0125] For example, the permission configuration interface adopts the form of a web page, such as... Figure 8 As shown, a permission configuration interface is displayed. Figure 8 The permission configuration interface shown includes an account or role selection box and a route structure tree. The route structure tree includes all route nodes under the main application and its sub-applications. The account or role selection box allows the permission configuration personnel to select the target account or role to be configured, and the route structure tree allows the permission configuration personnel to select all route nodes that the target account has the right to access.

[0126] Step 606: Based on the routing structure tree, configure permission information for at least one account in the multiple applications.

[0127] Personnel configuring permissions should follow steps 901-903 below to configure account permission information across the multiple applications. Specifically:

[0128] Step 901: Access the permission configuration page.

[0129] Specifically: The permission configuration personnel enter the address in the browser to enter the pre-developed permission configuration page; the permission configuration page pulls the entire micro-frontend application's route structure tree, all account lists, and all role lists from the server; the permission configuration page renders the account or role selection boxes and the route structure tree based on the information in step 902.

[0130] Step 902: Configure the permission information for the account or role on the permission configuration page.

[0131] Specifically: Clicking the account or role selection box displays all available accounts or roles in a drop-down menu; selecting an account or role from the drop-down menu causes the drop-down menu to disappear, and the selection box displays the selected account or role, with the selected account ID or role ID stored in memory; selecting one or more route nodes in the route structure tree stores the selected route nodes in memory as a list; clicking submit submits the aforementioned account ID or role ID and the corresponding permission list to the server via the API.

[0132] Step 903: After receiving the "Account ID - Permission List", the server replaces the "Permissions" field of the target item in the account table of the database with the new permission list. If the server receives the "Role ID - Permission List", the "Permissions" field of the item in the account table of the database whose "Role" field value matches the obtained "Role ID" is replaced with the new permission list.

[0133] Step 607: The main application performs permission checks on the access account for routing redirection requests based on the permission information of at least one account in the multiple applications.

[0134] Specifically: When a user enters the application, they enter their account and password to log in; after successful login, the main application obtains the permission list of the current account through the interface and stores it in memory; in the main application's route hook, based on the permission list, it determines whether the account has the necessary permissions for the route node to which it is to be redirected; if it does, the redirect is executed; otherwise, the redirect is not executed and a prompt message is output.

[0135] By having the main application perform permission checks on access accounts for routing requests, the logic for permission checks can be avoided by scattering it across various sub-applications, making it easier to maintain later.

[0136] Figure 9 An implementation device for a permission management method is demonstrated. The device specifically includes: an implementation scaffolding that includes pre-commit and upload script logic; an application scaffolding for initializing the application and configuring parameters; a permission configuration page for configuring permissions for accounts or roles; and permission judgment logic in the main application for judging permissions for route redirection requests.

[0137] The technical solution of this application achieves automatic updating and submission of routing information of multiple front-end applications by using hook scripts to submit application routing information to the server; it also achieves unified and efficient permission configuration by using a graphical configuration method for configuring the routing permissions of accounts or roles in all applications; and it avoids scattering the permission judgment logic in various sub-applications by having the main application perform permission judgments on the routing jumps of all applications, making the routing interception logic centralized and easy to maintain in the later stages.

[0138] To implement the method of the embodiments of this application, the embodiments of this application also provide a permission management device, such as... Figure 10 As shown, the device 100 includes:

[0139] The acquisition module 1001 is used to acquire routing information of multiple applications and the association relationship of the multiple applications;

[0140] The construction module 1002 is used to form a routing structure tree by combining the routing information of the multiple applications according to the association relationship; wherein the routing structure tree includes all routing nodes of the multiple applications;

[0141] Display module 1003 is used to display the route structure tree in the permission configuration interface;

[0142] Configuration module 1004 is used to configure permission information for at least one account in the multiple applications based on the routing structure tree;

[0143] The processing module 1005 is used to determine the permission of the access account for the routing request based on the permission information of at least one account in the multiple applications.

[0144] By employing the above technical solution, a route structure tree encompassing all route nodes is constructed using routing information and relationships among multiple applications. Based on this route structure tree, unified configuration of routing permissions for an account across multiple applications is implemented, and permission checks are performed on route redirection requests based on the configured permissions. Thus, by constructing a route structure tree and uniformly configuring routing permissions for an account across multiple applications, permission configuration becomes more consistent and efficient, effectively reducing subsequent maintenance costs.

[0145] In some embodiments, the routing information of the application includes all routing nodes of the application and the routing hierarchy relationship between all routing nodes; wherein, all routing nodes of a single application include a root routing node and M child routing nodes, where M is an integer greater than or equal to 0;

[0146] Here, the routing hierarchy among all route nodes can be derived from the hierarchy of the page paths corresponding to those route nodes. By distinguishing the route nodes hierarchically, the required route node can be quickly located based on the routing hierarchy among them.

[0147] In some embodiments, the association relationship includes the application hierarchy relationship among the plurality of applications; wherein, the application hierarchy relationship is used to divide the plurality of applications into one main application and N sub-applications, where N is an integer greater than or equal to 1.

[0148] By obtaining the application hierarchy relationship between multiple applications, the application that needs to be selected can be quickly found when configuring permissions.

[0149] In some embodiments, the construction module 1002 is used for

[0150] Based on the application hierarchy, the main application and sub-applications among the multiple applications are determined;

[0151] Based on the routing hierarchy, all routing nodes of the main application are divided into main application root routing nodes and main application sub-routing nodes, and all routing nodes of the sub-application are divided into sub-application root routing nodes and sub-application sub-routing nodes.

[0152] The routing structure tree is obtained by taking the main application root routing node as the first-level routing node, the main application sub-routing node and the sub-application root routing node as the second-level routing nodes, and the sub-application sub-routing node as the third-level routing node.

[0153] By dividing applications into main applications and sub-applications, and further dividing the main application and all its routing nodes into main application root routing nodes and main application sub-routing nodes, a routing structure tree can be constructed. This allows the routing structure tree to display all routing nodes under multiple applications more intuitively and systematically, making it easier for configuration personnel to configure permissions.

[0154] In some embodiments, the processing module 1005 is used for the main application to determine the permission of the access account for the routing request based on the permission information of at least one account in the plurality of applications.

[0155] In some embodiments, the configuration module 1004 is configured to select all routing nodes that the target account has the right to access in the multiple applications on the routing structure tree, to obtain the authorized routing nodes of the target account; and to use the authorized routing nodes as the permission information of the target account; wherein the target account is any one of the at least one accounts.

[0156] Here, by using the authorized routing node of the target account as the permission information of the target account, permission judgment can be performed on the account's routing request directly based on whether the routing node corresponding to the account's redirection request is an authorized routing node of that account.

[0157] By having the main application perform permission checks on access accounts for routing requests, the logic for permission checks can be avoided by scattering it across various sub-applications, making it easier to maintain later.

[0158] In some embodiments, the processing module 1005 is configured to obtain the access account of the accessing user; determine the permission information corresponding to the access account from the permission information of the at least one account in the plurality of applications; make a permission judgment on the routing request of the access account according to the permission information corresponding to the access account; if the permission information of the account includes the routing node corresponding to the routing request, then perform the redirection; if the permission information of the account does not include the routing node corresponding to the routing request, then cancel the redirection and display a prompt message.

[0159] After logging into an account, the permission information corresponding to that account is compared with the routing node corresponding to the routing request. The permission of the account's routing request can be determined directly based on whether the routing node corresponding to the account's routing request is a routing node included in the account's permission information.

[0160] In some embodiments, the device 100 further includes an update unit ( Figure 10 (Not shown in the diagram) is used to obtain the updated routing information submitted by the target application through a hook script, project scaffolding, or dependency package when the routing information of the target application is updated in the plurality of applications; and to use the updated routing information as the routing information of the target application.

[0161] By obtaining the updated routing information when the target application's routing information is updated, and using this updated routing information as the target application's routing information, the obtained routing information can be made up-to-date. The application can automatically submit the updated routing information when it is updated by using hook scripts, project scaffolding, or dependency packages.

[0162] Based on the hardware implementation of each unit in the above-mentioned access control device, this application embodiment also provides another access control device, such as... Figure 11 As shown, the device 110 includes: a processor 1101 and a memory 1102 configured to store computer programs capable of running on the processor;

[0163] When the processor 1101 is configured to run a computer program, it executes the method steps described in the foregoing embodiments.

[0164] Of course, in practical applications, such as Figure 11 As shown, the various components in this access control device are coupled together via a bus system 1103. It is understood that the bus system 1103 is used to implement communication between these components. In addition to a data bus, the bus system 1103 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 11 The general designated all buses as Bus System 1103.

[0165] In practical applications, the aforementioned processor can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), controller, microcontroller, and microprocessor. It is understood that, for different devices, the electronic devices used to implement the functions of the aforementioned processor can also be other types, and the embodiments of this application do not specifically limit this.

[0166] The aforementioned memory can be volatile memory, such as random-access memory (RAM); or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory, and provides instructions and data to the processor.

[0167] In an exemplary embodiment, this application also provides a computer-readable storage medium, such as a memory including a computer program, which can be executed by a processor of a rights management device to perform the steps of the aforementioned method.

[0168] It should be understood that the terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. The expressions “having,” “may have,” “comprising,” and “including,” or “may include” and “may contain” used herein may be used to indicate the presence of a corresponding feature (e.g., an element such as a number, function, operation, or component), but do not exclude the presence of additional features.

[0169] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and are not necessarily used to describe a specific order or sequence. For example, without departing from the scope of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.

[0170] The technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0171] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatus, and devices can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical, or other forms.

[0172] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0173] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0174] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for managing access permissions, characterized in that, The method includes: Obtain routing information for multiple applications, as well as the relationships between the multiple applications; wherein, the routing information of the applications includes all routing nodes of the application and the routing hierarchy relationships between all routing nodes; the relationships include the application hierarchy relationships between the multiple applications; Based on the aforementioned associations, the routing information of the multiple applications is organized into a routing structure tree; wherein, the routing structure tree includes all routing nodes of the multiple applications; Display the route structure tree in the permission configuration interface; Based on the routing structure tree, configure permission information for at least one account in the multiple applications; Based on the permission information of at least one account in the multiple applications, the access account is used to determine the permission of the routing request. The step of assembling the routing information of the multiple applications into a routing structure tree based on the association relationship includes: Based on the application hierarchy, the main application and sub-applications among the multiple applications are determined; Based on the routing hierarchy, all routing nodes of the main application are divided into main application root routing nodes and main application sub-routing nodes, and all routing nodes of the sub-application are divided into sub-application root routing nodes and sub-application sub-routing nodes. The routing structure tree is obtained by taking the main application root routing node as the first-level routing node, the main application sub-routing node and the sub-application root routing node as the second-level routing nodes, and the sub-application sub-routing node as the third-level routing node.

2. The method according to claim 1, characterized in that, All routing nodes in a single application include one root routing node and M child routing nodes, where M is an integer greater than or equal to 0.

3. The method according to claim 2, characterized in that, The application hierarchy is used to divide the multiple applications into one main application and N sub-applications, where N is an integer greater than or equal to 1.

4. The method according to claim 3, characterized in that, The step of determining the access account's permission for routing requests based on the permission information of at least one account in the multiple applications includes: The main application determines the access permissions of the accessing account by using the permission information of at least one account in the multiple applications for routing redirection requests.

5. The method according to claim 1, characterized in that, The step of configuring permission information for at least one account in the multiple applications based on the routing structure tree includes: Select all the routing nodes that the target account has the right to access in the multiple applications on the routing structure tree to obtain the authorized routing nodes of the target account; The authorized routing node is used as the permission information for the target account; The target account is any one of the at least one accounts.

6. The method according to claim 1, characterized in that, The step of determining the access account's permission for routing requests based on the permission information of at least one account in the multiple applications includes: Obtain the access account of the accessing user; The permission information corresponding to the access account is determined from the permission information of the at least one account in the multiple applications; Based on the permission information corresponding to the access account, the permission judgment is made on the routing request of the access account; If the account's permission information includes the route node corresponding to the route redirection request, then the redirection is executed; If the account's permission information does not include the route node corresponding to the route redirection request, the redirection will be canceled and a prompt message will be displayed.

7. The method according to claim 1, characterized in that, The method further includes: When the routing information of the target application is updated in the multiple applications, the updated routing information submitted by the target application through hook scripts, project scaffolding, or dependency packages is obtained. The updated routing information is used as the routing information for the target application.

8. An access control device, the device comprising: An acquisition module is used to acquire routing information of multiple applications and the association relationships of the multiple applications; wherein, the routing information of the applications includes all routing nodes of the applications and the routing hierarchy relationships between all routing nodes; the association relationships include the application hierarchy relationships between the multiple applications; A building module is used to assemble the routing information of the multiple applications into a routing structure tree based on the association relationship; wherein the routing structure tree includes all routing nodes of the multiple applications; The display module is used to display the route structure tree in the permission configuration interface; The configuration module is used to configure permission information for at least one account in the multiple applications based on the routing structure tree. The processing module is used to determine the permissions of the access account for the routing request based on the permission information of at least one account in the multiple applications. The construction module is further configured to determine the main application and sub-applications among the multiple applications based on the application hierarchy; and to divide all routing nodes of the main application into main application root routing nodes and main application sub-routing nodes based on the routing hierarchy, and to divide all routing nodes of the sub-applications into sub-application root routing nodes and sub-application sub-routing nodes; and to use the main application root routing node as a first-level routing node, the main application sub-routing nodes and the sub-application root routing node as second-level routing nodes, and the sub-application sub-routing nodes as third-level routing nodes to obtain the routing structure tree.

9. A data processing device, characterized in that, The device includes: a processor and a memory configured to store computer programs capable of running on the processor. Wherein, when the processor is configured to run the computer program, it performs the steps of the method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Front-end Vue page visual configuration method, device and storage medium

    CN110515683A

  • Authority information processing method and device

    CN112487405A