Dynamic authority management method and device of Web front end, medium and equipment

By dynamically managing user permissions on the web front-end and obtaining and rendering functional components according to user roles, the problems of inflexible permission control and inconvenient maintenance in the existing technology are solved, and efficient permission management and excellent user experience are achieved.

CN119718267AInactive Publication Date: 2025-03-28SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411671358.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the in-page function permission control depends on back-end logic or hard coding, which is difficult to adjust flexibly, and the maintenance cost is high, and the user cannot determine whether he has permission before the operation, resulting in a bad user experience.

Method used

By implementing dynamic permission management on the web front-end, the user determines his role after logging in, and obtains the corresponding set of control permissions, dynamically renders the functional components on the page, and only displays the functions that the user has permissions.

Benefits of technology

It realizes flexible permission control, reduces maintenance costs, improves user experience and system security, and avoids the problem of users being unable to determine permissions before operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718267A_ABST
    Figure CN119718267A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic authority management method and device of a Web front end, a medium and equipment. The method comprises the following steps: after a user logs in a Web front-end page, determining a role corresponding to the user, and taking the role corresponding to the user as a target role; acquiring a control permission set corresponding to the target role, and taking the acquired control permission set as a target control permission set; wherein a corresponding control permission set is configured for each role in advance, and the control permission set comprises a function identifier corresponding to each function component, with the operation permission, of the role; and rendering each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page to realize display of each functional component corresponding to each functional identifier in the target control permission set. According to the invention, differentiated management of function permissions of different users is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of page permission control, and in particular to a method, device, medium and equipment for dynamic permission management of a Web front end. Background Art

[0002] As the complexity of Web applications increases, permission management becomes a key link to ensure system security and improve user experience. In the existing technology, the permission control of page functions mostly relies on backend logic or is hard-coded in the front-end interface, which is difficult to adjust flexibly and has high maintenance costs.

[0003] According to our understanding, the following two solutions are currently being adopted:

[0004] (1) The front-end does not control the display, and all users can see it. When a user clicks an operation, the back-end will determine the user's permissions only after sending a request to the back-end. If the user does not have the permissions, the user will be prompted that he does not have the permissions. The disadvantage of this method is that users who do not have the corresponding function permissions can also see the corresponding function buttons, which will cause the user to find out that he does not have the permissions after operating a series of operations, and the previous operations and modifications will not work, which brings a very bad experience to the user.

[0005] (2) Customize and develop different pages according to different roles. This will cause great trouble to developers for pages that frequently add new functions. Summary of the invention

[0006] In view of at least one of the above technical problems, an embodiment of the present invention provides a method, device, medium, and equipment for dynamic permission management of a Web front end.

[0007] According to the first aspect, the dynamic permission management method of the Web front end provided by the embodiment of the present invention includes:

[0008] After the user logs in to the Web front-end page, determine the role corresponding to the user, and use the role corresponding to the user as the target role;

[0009] Acquire a control permission set corresponding to the target role, and use the acquired control permission set as the target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority for;

[0010] Each functional component corresponding to each functional identifier in the target control permission set is rendered on the Web front-end page to realize the display of each functional component corresponding to each functional identifier in the target control permission set.

[0011] In one embodiment, the functional component is a button, a table or an area.

[0012] In one embodiment, the pre-configuration process of the control permission set corresponding to each role includes:

[0013] Pre-acquire the functional components that require permission control on the Web front-end page, and assign a unique corresponding functional identifier to each functional component;

[0014] Determine the roles that can access the web front-end page;

[0015] A control permission set corresponding to each role is set, and the control permission set includes function identifiers corresponding to various function components that the role has operation authority for.

[0016] In one embodiment, obtaining the control permission set corresponding to the target role includes:

[0017] Subscribe to the topic object by calling the permission acquisition function;

[0018] Receive the control permission set corresponding to the target role returned by the subject object; wherein, if the control permission set corresponding to the target role has been cached in the subject object, the subject object returns the control permission set corresponding to the target role to the subscriber.

[0019] In one embodiment, obtaining the control permission set corresponding to the target role further includes:

[0020] If the content returned by the subject object is empty, the control permission set corresponding to the target role is obtained from the backend by calling the backend interface; wherein the backend persists the control permission set corresponding to each role.

[0021] In one embodiment, rendering each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page includes:

[0022] Build interface control instructions;

[0023] Execute the interface control instruction to achieve: determine the various functional components of the Web front-end page according to the HTML tag of the Web front-end page; use the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page, and use the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden; render the various functional components that need to be displayed on the Web front-end page on the Web front-end page.

[0024] In one embodiment, the method of using the function components corresponding to the function identifiers in the target control permission set as the function components that need to be displayed on the Web front-end page includes: setting the parameters corresponding to the function components corresponding to the function identifiers in the target control permission set to true; the method of using the other function components in the HTML tag except the function components corresponding to the function identifiers in the target control permission set as the function components that need to be hidden includes: setting the parameters corresponding to the other function components in the HTML tag except the function components corresponding to the function identifiers in the target control permission set to false;

[0025] Correspondingly, rendering each functional component that needs to be displayed on the Web front-end page on the Web front-end page includes: rendering each functional component whose parameter is true on the Web front-end page.

[0026] According to the second aspect, the dynamic rights management device of the Web front end provided by the embodiment of the present invention includes:

[0027] The first determination module is used to determine the role corresponding to the user after the user logs in to the Web front-end page, and use the role corresponding to the user as the target role;

[0028] A first acquisition module is used to acquire a control permission set corresponding to the target role, and use the acquired control permission set as a target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority for;

[0029] The component rendering module is used to render each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page to realize the display of each functional component corresponding to each functional identifier in the target control permission set.

[0030] In one embodiment, the functional component is a button, a table or an area.

[0031] In one embodiment, the apparatus comprises:

[0032] The pre-configuration module is used to pre-acquire the functional components on the Web front-end page that need to be subject to permission control, and assign a unique corresponding functional identifier to each functional component; determine the various roles that can access the Web front-end page; set a control permission set corresponding to each role, and the control permission set includes the functional identifiers corresponding to the various functional components that the role has operation authority.

[0033] In one embodiment, the first acquisition module is specifically used to: subscribe to a subject object by calling a permission acquisition function; receive a control permission set corresponding to the target role returned by the subject object; wherein, if the control permission set corresponding to the target role has been cached in the subject object, the subject object returns the control permission set corresponding to the target role to the subscriber.

[0034] In one embodiment, the first acquisition module is further specifically used for: if the content returned by the subject object is empty, obtaining the control permission set corresponding to the target role from the backend by calling the backend interface; wherein the backend persists the control permission set corresponding to each role.

[0035] In one embodiment, the component rendering module is specifically used to: construct interface control instructions; execute the interface control instructions to achieve: determine the various functional components of the Web front-end page according to the HTML tags of the Web front-end page; use the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page, and use the other functional components in the HTML tags except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden; render the various functional components that need to be displayed on the Web front-end page on the Web front-end page.

[0036] In one embodiment, the method of treating the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page includes: setting the parameters corresponding to the functional components corresponding to the various functional identifiers in the target control permission set to true; the method of treating the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden includes: setting the parameters corresponding to the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set to false; correspondingly, the method of rendering the various functional components that need to be displayed on the Web front-end page on the Web front-end page includes: rendering the various functional components whose parameters are true on the Web front-end page.

[0037] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0038] According to a fourth aspect, an embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0039] The dynamic permission management method, device, medium, and equipment for the Web front end provided by the embodiment of the present invention, after the user logs in to the Web front end page, determines the role corresponding to the user, and uses the role corresponding to the user as the target role, and then obtains the target control permission set corresponding to the target role, and renders each functional component corresponding to each functional identifier in the target control permission set on the Web front end page, thereby realizing the display of each functional component corresponding to each functional identifier in the target control permission set. The user interface only displays functions that are consistent with its permissions, ensuring that each user can only operate functions within the scope of their permissions, realizing differentiated management of functional permissions of different users, and enhancing user experience and system security. In addition, there is no need for developers to customize and develop different pages for different roles, and permission control is flexible, maintenance is convenient, and easy to expand, reducing long-term development and operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic diagram of a flow chart of a dynamic permission management method for a Web front end in one embodiment of the present invention;

[0041] Figure 2 The structure diagram of the dynamic rights management device of the Web front end in one embodiment of the present invention. DETAILED DESCRIPTION

[0042] In a first aspect, an embodiment of the present invention provides a method for dynamic permission management of a Web front end, see Figure 1 The method comprises the following steps S110 to S130:

[0043] S110, after the user logs in to the Web front-end page, determining the role corresponding to the user, and using the role corresponding to the user as the target role;

[0044] It is understandable that when registering, the user will fill in relevant basic information, such as user name, password, department, name, responsibilities, etc. For example, the corresponding role can be assigned to the user based on the department and responsibilities, etc. When the user logs in after registration, after successful login, the role corresponding to the user can be determined, and then the role can be used as the target role to participate in the subsequent steps.

[0045] S120, obtaining a control permission set corresponding to the target role, and using the obtained control permission set as a target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority for;

[0046] In one embodiment, the pre-configuration process of the control permission set corresponding to each role includes the following steps S11 to S13:

[0047] S11, pre-acquire the functional components that need to be subject to permission control on the Web front-end page, and assign a unique corresponding functional identifier to each functional component;

[0048] Among them, the functional components on the Web front-end page are the elements on the Web front-end page.

[0049] A functional component may be a button, a table or an area.

[0050] It is understandable that there are many functional components on the Web front-end page. Some functional components are open to all users; some functional components need to be open to some users, but not to other users. In this way, the functional components that may need to be partially open are the functional components that need permission control.

[0051] Among them, each functional component has its own unique functional identifier.

[0052] S12, determining each role that can access the Web front-end page;

[0053] It is understandable that there are multiple roles for accessing the Web front-end page, such as super administrator, ordinary administrator, first-level user, second-level user, etc.

[0054] S13: Set a control permission set corresponding to each role, where the control permission set includes function identifiers corresponding to each function component that the role has operation authority for.

[0055] That is, a corresponding control permission set is configured for each role, and the control permission set has one or more function identifiers, so that each user of the role has the authority to operate and control the functional components of the one or more function identifiers.

[0056] It can be seen that through the above S11 to S13, a corresponding control permission set can be set in advance for each role.

[0057] It is understandable that, since a corresponding control permission set has been pre-set for each role, the control permission set corresponding to the target role can be directly acquired in S120 and used as the target control permission set.

[0058] In one embodiment, the step of obtaining the control permission set corresponding to the target role may include S21 to S22:

[0059] S21. Subscribe to the subject object by calling the permission acquisition function;

[0060] S22. Receive the control permission set corresponding to the target role returned by the subject object; wherein, if the control permission set corresponding to the target role has been cached in the subject object, the subject object returns the control permission set corresponding to the target role to the subscriber.

[0061] The subject object may be ReplaySubject, which is a special multicast object that can resend all previous values ​​to new subscribers.

[0062] In order to implement S21-S22, you first need to define a subject object, namely subject, which is used to store the control permission set corresponding to each role and broadcast it to all subscribers. Then create a method, namely the permission acquisition function - getPermission(). When getPermission() is called, it can subscribe to the subject object. At this time, the caller of getPermission() is the new subscriber of the subject object. The subject object will find the corresponding control permission set according to the parameters corresponding to the target role passed by getPermission(), and return the control permission set to the new subscriber. Of course, this is achieved under the premise that the subject object caches the control permission set corresponding to the target role.

[0063] Therefore, in order to obtain the control permission set corresponding to the target role, the permission acquisition function is first called to subscribe to the subject object. If the subject object caches the control permission set corresponding to the target role, the control permission set returned from the subject object will be received, that is, the target control permission set. In this way, frequent calls to the backend interface can be avoided.

[0064] In one embodiment, the acquiring of the control permission set corresponding to the target role may further include S23:

[0065] S23. If the content returned by the subject object is empty, the control permission set corresponding to the target role is obtained from the backend by calling the backend interface; wherein the backend persists the control permission set corresponding to each role.

[0066] That is to say, if the content returned by the subject object is empty, it means that the subject object cache does not store the control permission set corresponding to the target role. At this time, the backend interface can be called, so that the backend interface will obtain the control permission set corresponding to the target role from the database. It can be seen that the control permission set corresponding to each role will be persisted in the backend database in advance.

[0067] There are usually two ways to obtain the control permission set: one is to request the backend to obtain it when logging in and store it in local storage or session storage; the other is to obtain it immediately when entering the page. Although the former is simple, if the control permission set is changed, the user needs to log out and log in again to take effect, and if the cache is cleared, the control permission set cannot be obtained. The latter is suitable for a single page. If there are multiple pages, there will be code redundancy, and the interface calls are frequent, which is difficult to maintain. The embodiment of the present invention uses the ReplaySubject of the RxJS library to solve these problems.

[0068] S130: Rendering each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page to display each functional component corresponding to each functional identifier in the target control permission set.

[0069] It is understandable that after determining the target control permission set, we can know which functional components the user has the authority to operate and control, so these functional components are rendered on the Web front-end page, so that the functional components corresponding to the various function identifiers in the target control permission set are displayed on the Web front-end page, and users can operate and control these functional components.

[0070] In one embodiment, rendering each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page may include S31-S32:

[0071] S31, constructing interface control instructions;

[0072] S32. Execute the interface control instruction to achieve: determine the various functional components of the Web front-end page according to the HTML tag of the Web front-end page; use the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page, and use the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden; render the various functional components that need to be displayed on the Web front-end page on the Web front-end page.

[0073] It is understandable that each functional component on the Web front-end page is recorded in an HTML tag. After determining the target control permission set, the functional components corresponding to each functional identifier in the target control permission set are the functional components that need to be displayed, and the other functional components in the HTML tag are the functional components that need to be hidden, so the functional components that need to be displayed are rendered on the Web front-end page. This process is achieved by executing interface control instructions, which are a type of structural instructions.

[0074] Wherein, the said using the functional components corresponding to the various functional identifiers in the target control permission set as the functional components that need to be displayed on the Web front-end page may include: setting the parameters corresponding to the functional components corresponding to the various functional identifiers in the target control permission set to true; the said using the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as the functional components that need to be hidden may include: setting the parameters corresponding to the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set to false;

[0075] Correspondingly, rendering each functional component that needs to be displayed on the Web front-end page on the Web front-end page may include: rendering each functional component whose parameter is true on the Web front-end page.

[0076] Taking the operation button as an example, the function identifier of the operation button is a, and the target control permission set is P. If a is included in P, the parameter of the operation button is true. If a is not included in P, the parameter of the operation button is false. Usually, the parameters of the operation button can be controlled to display and hide the operation button through the built-in instructions of the Angular framework or the built-in instructions of the Vue framework. Although this can achieve the purpose, when there are many function identifiers in the target control permission set, each function identifier must be judged once, which will cause the code to be complicated, difficult to maintain, and inconvenient to develop. Therefore, a structural instruction is customized in the embodiment of the present invention, and logical judgment is performed in the instruction, which is convenient and concise.

[0077] It can be seen that the embodiment of the present invention realizes dynamic permission control on the Web front end through interface control instructions and ReplaySubject caching mechanism, effectively solving the problems of inflexible permission control and inconvenient maintenance in the prior art, improving the flexibility and efficiency of permission management, and enabling system administrators to quickly respond to permission change requirements without frequent code modifications, thereby simplifying the permission change response process. Moreover, the user interface only displays functions that are consistent with its permissions, enhancing user experience and system security. Moreover, the method provided by the embodiment of the present invention makes permission control easy to maintain and expand, reducing long-term development and operation and maintenance costs. In addition, the ReplaySubject object cache is used to obtain the target control permission set to avoid repeated calls to the back-end interface and improve efficiency.

[0078] It can be seen that in order to address the problems in the prior art of inflexible permission control and inconvenient maintenance, the present invention can dynamically adjust the accessibility of interface elements according to the function identifiers in the control permission set corresponding to the user's role, ensuring that each user can only operate functions within the scope of his or her permission, thereby achieving differentiated management of functional permissions of different users, improving system security and user experience, and being able to adapt to scenarios where different users have different functional access requirements.

[0079] In a second aspect, an embodiment of the present invention provides a dynamic rights management device for a Web front end, see Figure 2 , the device 100 comprises:

[0080] The first determination module 110 is used to determine the role corresponding to the user after the user logs in to the Web front-end page, and use the role corresponding to the user as the target role;

[0081] The first acquisition module 120 is used to acquire the control permission set corresponding to the target role, and use the acquired control permission set as the target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority;

[0082] The component rendering module 130 is used to render each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page to realize the display of each functional component corresponding to each functional identifier in the target control permission set.

[0083] In one embodiment, the functional component is a button, a table or an area.

[0084] In one embodiment, the apparatus comprises:

[0085] The pre-configuration module is used to pre-acquire the functional components on the Web front-end page that need to be subject to permission control, and assign a unique corresponding functional identifier to each functional component; determine the various roles that can access the Web front-end page; set a control permission set corresponding to each role, and the control permission set includes the functional identifiers corresponding to the various functional components that the role has operation authority.

[0086] In one embodiment, the first acquisition module is specifically used to: subscribe to a subject object by calling a permission acquisition function; receive a control permission set corresponding to the target role returned by the subject object; wherein, if the control permission set corresponding to the target role has been cached in the subject object, the subject object returns the control permission set corresponding to the target role to the subscriber.

[0087] In one embodiment, the first acquisition module is further specifically used for: if the content returned by the subject object is empty, obtaining the control permission set corresponding to the target role from the backend by calling the backend interface; wherein the backend persists the control permission set corresponding to each role.

[0088] In one embodiment, the component rendering module is specifically used to: construct interface control instructions; execute the interface control instructions to achieve: determine the various functional components of the Web front-end page according to the HTML tags of the Web front-end page; use the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page, and use the other functional components in the HTML tags except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden; render the various functional components that need to be displayed on the Web front-end page on the Web front-end page.

[0089] In one embodiment, the method of treating the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page includes: setting the parameters corresponding to the functional components corresponding to the various functional identifiers in the target control permission set to true; the method of treating the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden includes: setting the parameters corresponding to the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set to false; correspondingly, the method of rendering the various functional components that need to be displayed on the Web front-end page on the Web front-end page includes: rendering the various functional components whose parameters are true on the Web front-end page.

[0090] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0091] In a third aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0092] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0093] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0094] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0095] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0096] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0097] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0098] In a fourth aspect, an embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any embodiment of the specification.

[0099] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0101] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0102] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A dynamic permission management method for a Web front end, characterized in that: include: After the user logs in to the Web front-end page, determine the role corresponding to the user, and use the role corresponding to the user as the target role; Acquire a control permission set corresponding to the target role, and use the acquired control permission set as the target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority for; Each functional component corresponding to each functional identifier in the target control permission set is rendered on the Web front-end page to realize the display of each functional component corresponding to each functional identifier in the target control permission set.

2. The method according to claim 1, characterized in that The functional component is a button, a table or an area.

3. The method according to claim 1, characterized in that: The pre-configuration process of the control permission set corresponding to each role includes: Pre-acquire the functional components that require permission control on the Web front-end page, and assign a unique corresponding functional identifier to each functional component; Determine the roles that can access the web front-end page; A control permission set corresponding to each role is set, and the control permission set includes function identifiers corresponding to various function components that the role has operation authority for.

4. The method according to claim 1, characterized in that: The obtaining of the control permission set corresponding to the target role includes: Subscribe to the topic object by calling the permission acquisition function; Receive the control permission set corresponding to the target role returned by the subject object; wherein, if the control permission set corresponding to the target role has been cached in the subject object, the subject object returns the control permission set corresponding to the target role to the subscriber.

5. The method according to claim 4, characterized in that The step of obtaining the control permission set corresponding to the target role further includes: If the content returned by the subject object is empty, the control permission set corresponding to the target role is obtained from the backend by calling the backend interface; wherein the backend persists the control permission set corresponding to each role.

6. The method according to claim 1, characterized in that The rendering of each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page includes: Build interface control instructions; Execute the interface control instruction to achieve: determine the various functional components of the Web front-end page according to the HTML tag of the Web front-end page; use the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be displayed on the Web front-end page, and use the other functional components in the HTML tag except the functional components corresponding to the various functional identifiers in the target control permission set as functional components that need to be hidden; render the various functional components that need to be displayed on the Web front-end page on the Web front-end page.

7. The method according to claim 1, characterized in that The method of using the function components corresponding to the function identifiers in the target control permission set as the function components that need to be displayed on the Web front-end page includes: setting the parameters corresponding to the function components corresponding to the function identifiers in the target control permission set to true; the method of using the function components in the HTML tag other than the function components corresponding to the function identifiers in the target control permission set as the function components that need to be hidden includes: setting the parameters corresponding to the function components in the HTML tag other than the function components corresponding to the function identifiers in the target control permission set to false; Correspondingly, rendering each functional component that needs to be displayed on the Web front-end page on the Web front-end page includes: rendering each functional component whose parameter is true on the Web front-end page.

8. A dynamic rights management device for a Web front end, characterized in that: include: The first determination module is used to determine the role corresponding to the user after the user logs in to the Web front-end page, and use the role corresponding to the user as the target role; A first acquisition module is used to acquire a control permission set corresponding to the target role, and use the acquired control permission set as a target control permission set; wherein a corresponding control permission set is pre-configured for each role, and the control permission set includes function identifiers corresponding to each function component that the role has operation authority for; The component rendering module is used to render each functional component corresponding to each functional identifier in the target control permission set on the Web front-end page to realize the display of each functional component corresponding to each functional identifier in the target control permission set.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Permission control method, device and equipment and storage medium

    CN112651041A

  • Method and device for controlling display permission of page elements, equipment and medium

    CN113536253A

  • System page customization generation method and device and medical system page customization method and device

    CN118192968A

  • User operation permission control method and apparatus, device, and medium

    WO2020233039A1

Cited By

  • Authority control method and electronic equipment

    CN120705898A

  • Permission management method and device based on Next.js, equipment and medium

    CN121530646A

  • Method and system for changing management background interface menu for different post personnel

    CN121957416A