Permission configuration method and device, equipment and storage medium
By automatically obtaining and generating menus and permission information, the efficiency and accuracy of permission configuration is achieved, and the problems of inefficient and low accuracy of configuration permissions in the existing technology are solved, and the permission management process in large backend management systems is simplified.
Patent Information
- Application Number
- CN202311654341.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-12-13
AI Technical Summary
The method of configuring permissions in the prior art is inefficient and has low accuracy, especially in large backend management systems, where menu data is large and permissions are scattered, resulting in the process of adding menus and permission configurations being long and prone to errors.
Get the service's unified resource identifier through menu synchronization commands, determine the newly added unified resource identifier and its parent menu, generate new menus and permission information, and display them on the front end, users can choose to bind target roles and menus , automatically configure permissions to reduce user operation steps.
It improves the efficiency and accuracy of permission configuration, reduces manual configuration steps, simplifies the permission binding process, and solves the problems of inefficiency and low accuracy in the existing technology.
Smart Images

Figure CN119128955A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular to a permission configuration method, apparatus, device, and storage medium. Background Art
[0002] At present, menus and permissions are the most basic functions in the background management system. For some larger background management systems, the menus contain a lot of data and the permission functions are also scattered. Often after adding a menu, it is necessary to find an administrator / person in charge to bind the relevant permissions to the corresponding role before functional testing can be performed. Generally, one menu contains four interfaces: add, delete, modify and check. The process of adding one menu and permissions requires manual configuration five times (including adding a new menu and adding four permissions). The whole process is relatively time-consuming, and permissions are prone to misconfiguration when there are many menus.
[0003] In summary, the method for configuring permissions in the prior art has technical problems of low configuration efficiency and low accuracy. Summary of the invention
[0004] The embodiments of the present invention provide a permission configuration method, apparatus, device and storage medium. The embodiments of the present invention can improve the efficiency and accuracy of configuring permissions, and solve the technical problems of low configuration efficiency and low accuracy in the method of configuring permissions in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a method for configuring permissions, including:
[0006] In response to the menu synchronization instruction, obtaining a first uniform resource identifier after the service is started, and querying a second uniform resource identifier already in the menu of the service;
[0007] Determine a third uniform resource identifier newly added to the service according to the first uniform resource identifier and the second uniform resource identifier;
[0008] Determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship;
[0009] Generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier;
[0010] In response to the permission binding instruction, a target role and a target new menu are determined, and permissions are configured for the target role according to permission information corresponding to the target new menu.
[0011] Preferably, determining a third uniform resource identifier newly added to the service according to the first uniform resource identifier and the second uniform resource identifier includes:
[0012] Compare the first uniform resource identifier with the second uniform resource identifier to determine a uniform resource identifier that is newly added to the first uniform resource identifier compared to the second uniform resource identifier;
[0013] The newly added uniform resource identifier is determined as a third uniform resource identifier newly added to the service.
[0014] Preferably, determining the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship includes:
[0015] Determining, according to a preset mapping relationship, tag information corresponding to the third uniform resource identifier;
[0016] The parent menu to which the third uniform resource identifier belongs is determined according to the tag information.
[0017] Preferably, after generating the newly added menu under the parent menu and the corresponding permission information, and before responding to the permission binding instruction, the method further includes:
[0018] The newly added menu and corresponding permission information are displayed on the front end.
[0019] Preferably, the displaying of the newly added menu and the corresponding permission information on the front end includes:
[0020] The newly added menu is displayed on the front end, and the permission information corresponding to the newly added menu is displayed in the form of a sub-list in the newly added menu.
[0021] Preferably, it also includes:
[0022] In response to the information modification instruction, after modifying the newly added menu and the corresponding permission information, the newly added menu and the corresponding permission information displayed on the front end are updated.
[0023] Preferably, configuring permissions for the target role according to permission information corresponding to the target newly added menu includes:
[0024] The target permission of the target role is determined according to the permission information corresponding to the target newly added menu, and the preset role access control model is called to configure the target permission for the target role.
[0025] In a second aspect, an embodiment of the present invention provides a permission configuration device, including:
[0026] A menu synchronization module, for obtaining a first uniform resource identifier after the service is started in response to a menu synchronization instruction, and querying a second uniform resource identifier already existing in the menu of the service;
[0027] A newly added URI determination module is used to determine a third uniform resource identifier newly added to the service according to the first uniform resource identifier and the second uniform resource identifier;
[0028] A menu determination module, used to determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship;
[0029] A new menu generation module, used to generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier;
[0030] The permission binding module is used to determine the target role and the target new menu in response to the permission binding instruction, and configure permissions for the target role according to the permission information corresponding to the target new menu.
[0031] In a third aspect, an embodiment of the present invention provides a permission configuration device, the permission configuration device comprising a processor and a memory;
[0032] The memory is used to store a computer program and transmit the computer program to the processor;
[0033] The processor is used to execute a permission configuration method as described in the first aspect according to instructions in the computer program.
[0034] In a fourth aspect, an embodiment of the present invention provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute a permission configuration method as described in the first aspect.
[0035] As described above, the embodiment of the present invention provides a permission configuration method, apparatus, device and storage medium. In the embodiment of the present invention, after the user sends a menu synchronization instruction to the permission configuration device in the front end, the permission configuration device can automatically obtain the third uniform resource identifier newly added in the service and the parent menu to which the third uniform resource identifier belongs, and generate a new menu under the parent menu and corresponding permission information in the front end. After that, the user can select the required binding and target role and the target new menu in the front end, and the permission configuration device can assign the permission corresponding to the target new menu to the target role. The embodiment of the present invention can automatically realize the configuration of role permissions, greatly reducing the steps required by the user, improving the configuration efficiency and accuracy of permissions, and solving the technical problems of low configuration efficiency and low accuracy in the method of configuring permissions in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flowchart of a permission configuration method provided by an embodiment of the present invention.
[0037] Figure 2 A schematic diagram of a permission configuration method provided by an embodiment of the present invention.
[0038] Figure 3 A schematic diagram of the structure of a permission configuration device provided by an embodiment of the present invention.
[0039] Figure 4 A schematic diagram of the structure of a permission configuration device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following description and accompanying drawings fully illustrate the specific embodiments of the present application so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operation can vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is disclosed in fact, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0041] like Figure 1 As shown, Figure 1 A flowchart of a permission configuration method provided by an embodiment of the present invention. The permission configuration method provided by an embodiment of the present invention can be executed by a permission configuration device, which can be implemented by software and / or hardware. The permission configuration device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the permission configuration device can be a computer, a host computer, a tablet, etc. The method includes the following steps:
[0042] Step 101: In response to a menu synchronization instruction, a first uniform resource identifier after a service is started is obtained, and a second uniform resource identifier existing in a menu of a query service is obtained.
[0043] In this embodiment, the permission configuration device first needs to respond to the menu synchronization instruction, wherein the menu synchronization instruction is used to instruct the permission configuration device to synchronize the menu information, and the user can send the menu synchronization instruction to the permission configuration device by interacting with the permission configuration device. Exemplarily, the user can use an interactive device (such as a mouse and keyboard) to click a "Synchronize Menu" button on the front page of the permission configuration device to send the menu synchronization instruction to the permission configuration device.
[0044] When the permission configuration device responds to the menu synchronization instruction, it will first obtain all the first uniform resource identifiers after the service is started, where the uniform resource identifier is a URI (Uniform Resource Identifier). The uniform resource identifier is a string used to identify the name of an Internet resource. This identifier allows users to interact with any resource (including local and Internet) through a specific protocol. Each resource available on the Web (HTML documents, images, video clips, programs, etc.) can be located by a universal resource identifier (Uniform Resource Identifier, referred to as URI). While obtaining the first uniform resource identifier after the service is started, the permission configuration device also needs to query the second uniform resource identifier already in the service menu.
[0045] It should also be noted that in this embodiment, the functions of the permission configuration device to obtain the first uniform resource identifier and query the second uniform resource identifier can be implemented through a preset configuration code. The user can develop relevant code in the back-end of the permission configuration device in advance, and deploy the developed code to the corresponding environment of the service. The corresponding code can be run in the subsequent back-end to implement the corresponding function.
[0046] Step 102: Determine a third uniform resource identifier added to the service according to the first uniform resource identifier and the second uniform resource identifier.
[0047] After determining the first uniform resource identifier and the second uniform resource identifier, the permission configuration device can determine the third uniform resource identifier newly added to the service based on the first uniform resource identifier and the second uniform resource identifier. Exemplarily, the permission configuration device can compare the first uniform resource identifier and the second uniform resource identifier to determine the newly added third uniform resource identifier. It should be noted that the menu includes the function of the permission, and the composition of the permission includes a name and a URI. The URI uniquely identifies the action that can be operated. For example, admin / access / index represents that the permission list page can be operated.
[0048] In one embodiment, step 102 determines a third uniform resource identifier added to the service according to the first uniform resource identifier and the second uniform resource identifier, including:
[0049] Step 1021: Compare the first uniform resource identifier and the second uniform resource identifier to determine a uniform resource identifier that is newly added to the first uniform resource identifier compared to the second uniform resource identifier.
[0050] In one embodiment, the first uniform resource identifier and the second uniform resource identifier may be compared first to determine the uniform resource identifier that is newly added to the first uniform resource identifier compared to the second uniform resource identifier.
[0051] Step 1022: determine the newly added uniform resource identifier as the third uniform resource identifier newly added to the service.
[0052] After the newly added uniform resource identifier is determined, the newly added uniform resource identifier can be determined as the third uniform resource identifier newly added in the service menu, and the third uniform resource identifier corresponds to the permission that needs to be added.
[0053] The above is the specific process of determining the newly added third uniform resource identifier.
[0054] Step 103: Determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship.
[0055] After determining the third uniform resource identifier, the permission configuration device needs to further determine the parent menu to which the third uniform resource identifier belongs according to the pre-configured mapping relationship. For example, during the development of the back-end code, the user can pre-determine the parent menu corresponding to each URI and set the mapping relationship, and the subsequent permission configuration device can directly determine the parent menu to which the third uniform resource identifier belongs according to the pre-set mapping relationship.
[0056] Based on the above embodiment, in step 103, determining the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship includes:
[0057] Step 1031: Determine tag information corresponding to the third uniform resource identifier according to a preset mapping relationship.
[0058] In one embodiment, when determining the parent menu of the third uniform resource identifier, it is first necessary to determine the label information corresponding to the third uniform resource identifier, that is, the tag information, according to the pre-set mapping relationship. In one embodiment, when writing the backend code, the user needs to specify the tag information corresponding to the URI and determine the mapping relationship, wherein the tag information is the name of the parent menu corresponding to the URI, so as to facilitate the subsequent automatic generation of the menu, and accurately distinguish which parent menu the corresponding URI belongs to.
[0059] Step 1032: Determine the parent menu to which the third uniform resource identifier belongs according to the tag information.
[0060] After the tag information corresponding to the third uniform resource identifier is determined, the parent menu to which the third uniform resource identifier belongs can be determined according to the tag information.
[0061] The above is the specific process of determining the parent menu to which the third uniform resource identifier belongs.
[0062] Step 104: Generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier.
[0063] After determining the parent menu with the third uniform resource identifier, the basic information of the menu and the basic information of the permissions under the menu can be constructed according to the third uniform resource identifier, thereby generating a new menu under the parent menu and the corresponding permission information. In one embodiment, the permission configuration device can find the interface that has not been added according to the third uniform resource identifier, and then automatically assemble the new menu and the corresponding permission information according to the interface information.
[0064] On the basis of the above embodiment, after generating a new menu under the parent menu and the corresponding permission information, before responding to the permission binding instruction, it also includes: displaying the new menu and the corresponding permission information on the front end.
[0065] Step 1041: Display the newly added menu on the front end, and display the permission information corresponding to the newly added menu in the form of a sub-list in the newly added menu.
[0066] In one embodiment, after generating a new menu under the parent menu and the corresponding permission information, the permission configuration device can further display the new menu in the front end. Exemplarily, the new menu can be displayed in a table, and each new menu has a sublist, which is used to display the corresponding permission information under the new menu.
[0067] Based on the above embodiment, it also includes:
[0068] Step 1042: in response to the information modification instruction, after modifying the newly added menu and the corresponding permission information, the newly added menu and the corresponding permission information displayed on the front end are updated.
[0069] In one embodiment, after the permission configuration device displays the newly added menu and the corresponding permission information in the front end, the user can further modify the newly added menu and the permission information according to actual needs. Specifically, the user can interact with the permission configuration device through an interactive device, and modify the newly added menu and the corresponding permission information by sending an information modification instruction to the permission configuration device. The modification process can be adding, deleting, and editing, etc., which can be set according to actual needs. After the permission configuration device responds to the information modification instruction and modifies the newly added menu and the permission information, the newly added menu and the corresponding permission information displayed in the front end are synchronously updated to ensure the consistency of information.
[0070] Step 105 : In response to the permission binding instruction, determine the target role and the target new menu, and configure permissions for the target role according to the permission information corresponding to the target new menu.
[0071] After the front end displays the newly added menu and permission information, the user can further bind the newly added menu with the corresponding permission information and role in the front end, thereby assigning permissions to the role. Exemplarily, the user can select the target role and target newly added menu to be bound through the interactive device in the front end, and after the selection is completed, send a permission binding instruction to the permission configuration device. The permission configuration device responds to the permission binding instruction and configures permissions for the target role according to the permission information corresponding to the target newly added menu. In another embodiment, when the user selects the newly added menu by target in the front end, he or she may also only select the parent menu, and the permission configuration device may use the newly added menu under the parent menu as the target newly added menu. In one embodiment, the principle of the permission configuration method provided in an embodiment of the present invention is as follows: Figure 2 shown.
[0072] On the basis of the above embodiment, the target permission of the target role is determined according to the permission information corresponding to the target newly added menu, and the preset role access control model is called to configure the target permission for the target role.
[0073] In one embodiment, when configuring permissions for a target role, the target permissions of the target role can be first determined based on the permission information corresponding to the target newly added menu. After the target permissions are determined, the preset role access control model can be further called, and the role access control model can be used to configure the target permissions for the target role. For example, the role access control model can be an RBAC (Role-Based Access Control) model, which allows high-level access to be created and implemented by assigning a set of permissions. Permissions are based on the access level required for a specific user category to perform their duties, that is, different people in a company can have completely different levels and types of access permissions based entirely on factors such as their job functions and responsibilities. The specific working principle of the RBAC model can refer to the prior art and will not be repeated in this embodiment.
[0074] In one embodiment, when a user needs to reconstruct a background management system containing 100 menus and 400 permissions, assuming that 4 interfaces need to be added, deleted, modified and checked under each menu, after each menu is developed, 1 menu and 4 permissions need to be manually configured. If 5 menus are added at one time, 5 menus and 20 permissions need to be configured. The entire configuration process is time-consuming, inefficient and prone to errors. After using the permission configuration method provided in the embodiment of the present invention, batch menu generation and permission function binding can be realized, thereby improving the configuration efficiency and accuracy of permissions.
[0075] As described above, an embodiment of the present invention provides a method for configuring permissions. In the embodiment of the present invention, after the user sends a menu synchronization instruction to the permission configuration device in the front end, the permission configuration device can automatically obtain the third uniform resource identifier newly added in the service and the parent menu to which the third uniform resource identifier belongs, and generate a new menu under the parent menu and corresponding permission information in the front end. After that, the user can select the required binding and target role and the target new menu in the front end, and the permission configuration device can assign the permissions corresponding to the target new menu to the target role. The embodiment of the present invention can automatically implement the configuration of role permissions, greatly reducing the steps required by the user, improving the configuration efficiency and accuracy of permissions, and solving the technical problems of low configuration efficiency and low accuracy in the method of configuring permissions in the prior art.
[0076] The embodiment of the present invention also provides a permission configuration device, such as Figure 3 As shown, Figure 3 A schematic diagram of the structure of a permission configuration device provided in an embodiment of the present invention. The permission configuration device provided in an embodiment of the present invention includes:
[0077] The menu synchronization module 201 is used to obtain the first uniform resource identifier after the service is started in response to the menu synchronization instruction, and query the second uniform resource identifier already in the menu of the service;
[0078] A newly added URI determination module 202 is used to determine a third newly added uniform resource identifier for the service according to the first uniform resource identifier and the second uniform resource identifier;
[0079] The menu determination module 203 is used to determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship;
[0080] A new menu generating module 204 is used to generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier;
[0081] The permission binding module 205 is used to determine the target role and the target new menu in response to the permission binding instruction, and configure permissions for the target role according to the permission information corresponding to the target new menu.
[0082] Based on the above embodiment, the newly added URI determination module 202 includes:
[0083] An identifier comparison submodule, configured to compare the first uniform resource identifier with the second uniform resource identifier, and determine a uniform resource identifier newly added to the first uniform resource identifier compared to the second uniform resource identifier;
[0084] The newly added identifier determination submodule is used to determine the newly added uniform resource identifier as the third uniform resource identifier newly added to the service.
[0085] Based on the above embodiment, the menu determination module 203 includes:
[0086] A tag determination submodule, used to determine tag information corresponding to the third uniform resource identifier according to a preset mapping relationship;
[0087] The parent menu determination submodule is used to determine the parent menu to which the third uniform resource identifier belongs according to the tag information.
[0088] Based on the above embodiment, it also includes:
[0089] The information display module is used to display the newly added menu and the corresponding permission information on the front end after generating the newly added menu and the corresponding permission information under the parent menu and before responding to the permission binding instruction.
[0090] On the basis of the above embodiment, the information display module is specifically used to display the newly added menu on the front end, and display the permission information corresponding to the newly added menu in the form of a sub-list in the newly added menu.
[0091] Based on the above embodiment, it also includes:
[0092] The information modification module is used to respond to the information modification instruction, modify the newly added menu and the corresponding permission information, and then update the newly added menu and the corresponding permission information displayed on the front end.
[0093] On the basis of the above embodiment, the permission binding module 205 is specifically used to determine the target permission of the target role according to the permission information corresponding to the target new menu, and call the preset role access control model to configure the target permission for the target role.
[0094] The permission configuration apparatus provided in the embodiment of the present invention is included in the permission configuration device and can be used to execute the permission configuration method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0095] It is worth noting that in the embodiment of the above-mentioned permission configuration device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0096] This embodiment also provides a permission configuration device, such as Figure 4 As shown, Figure 4 A schematic diagram of a structure of a permission configuration device provided in an embodiment of the present invention, wherein the permission configuration device 30 includes a processor 300 and a memory 301;
[0097] The memory 301 is used to store the computer program 302 and transmit the computer program 302 to the processor 300;
[0098] The processor 300 is used to execute the steps in the above-mentioned embodiment of a permission configuration method according to the instructions in the computer program 302.
[0099] Exemplarily, the computer program 302 may be divided into one or more modules / units, one or more modules / units are stored in the memory 301, and are executed by the processor 300 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 302 in the permission configuration device 30.
[0100] The permission configuration device 30 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The permission configuration device 30 may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will appreciate that Figure 4It is only an example of the permission configuration device 30 and does not constitute a limitation of the permission configuration device 30. It can include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the permission configuration device 30 can also include input and output devices, network access devices, buses, etc.
[0101] The processor 300 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0102] The memory 301 may be an internal storage unit of the permission configuration device 30, such as a hard disk or memory of the permission configuration device 30. The memory 301 may also be an external storage device of the permission configuration device 30, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the permission configuration device 30. Further, the memory 301 may also include both an internal storage unit of the permission configuration device 30 and an external storage device. The memory 301 is used to store computer programs and other programs and data required by the permission configuration device 30. The memory 301 may also be used to temporarily store data that has been output or is to be output.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0104] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store computer programs.
[0108] An embodiment of the present invention further provides a storage medium containing computer executable instructions, which are used to execute a permission configuration method when executed by a computer processor. The method includes the following steps:
[0109] In response to the menu synchronization instruction, obtaining a first uniform resource identifier after the service is started, and querying a second uniform resource identifier already in the menu of the service;
[0110] Determine a third uniform resource identifier added to the service according to the first uniform resource identifier and the second uniform resource identifier;
[0111] Determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship;
[0112] Generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier;
[0113] In response to the permission binding instruction, a target role and a target new menu are determined, and permissions are configured for the target role according to permission information corresponding to the target new menu.
[0114] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims
1. A permission configuration method, characterized in that: include: In response to the menu synchronization instruction, obtaining a first uniform resource identifier after the service is started, and querying a second uniform resource identifier already in the menu of the service; Determine a third uniform resource identifier newly added to the service according to the first uniform resource identifier and the second uniform resource identifier; Determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship; Generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier; In response to the permission binding instruction, a target role and a target new menu are determined, and permissions are configured for the target role according to permission information corresponding to the target new menu.
2. The permission configuration method according to claim 1, characterized in that: The determining, according to the first uniform resource identifier and the second uniform resource identifier, a third uniform resource identifier newly added to the service includes: Compare the first uniform resource identifier with the second uniform resource identifier to determine a uniform resource identifier that is newly added to the first uniform resource identifier compared to the second uniform resource identifier; The newly added uniform resource identifier is determined as a third uniform resource identifier newly added to the service.
3. The permission configuration method according to claim 1, characterized in that: The determining, according to a preset mapping relationship, the parent menu to which the third uniform resource identifier belongs includes: Determining, according to a preset mapping relationship, tag information corresponding to the third uniform resource identifier; The parent menu to which the third uniform resource identifier belongs is determined according to the tag information.
4. The permission configuration method according to claim 1, characterized in that: After generating the new menu under the parent menu and the corresponding permission information, before responding to the permission binding instruction, the method further includes: The newly added menu and corresponding permission information are displayed on the front end.
5. The permission configuration method according to claim 4, characterized in that: The displaying of the newly added menu and the corresponding permission information on the front end includes: The newly added menu is displayed on the front end, and the permission information corresponding to the newly added menu is displayed in the form of a sub-list in the newly added menu.
6. The permission configuration method according to claim 4, characterized in that: Also includes: In response to the information modification instruction, after modifying the newly added menu and the corresponding permission information, the newly added menu and the corresponding permission information displayed on the front end are updated.
7. The permission configuration method according to claim 1, characterized in that: The configuring permissions for the target role according to the permission information corresponding to the target newly added menu includes: The target permission of the target role is determined according to the permission information corresponding to the target newly added menu, and the preset role access control model is called to configure the target permission for the target role.
8. A permission configuration device, characterized in that: include: A menu synchronization module, for obtaining a first uniform resource identifier after the service is started in response to a menu synchronization instruction, and querying a second uniform resource identifier already existing in the menu of the service; A newly added URI determination module is used to determine a third uniform resource identifier newly added to the service according to the first uniform resource identifier and the second uniform resource identifier; A menu determination module, used to determine the parent menu to which the third uniform resource identifier belongs according to a preset mapping relationship; A new menu generation module, used to generate a new menu under the parent menu and corresponding permission information according to the third uniform resource identifier; The permission binding module is used to determine the target role and the target new menu in response to the permission binding instruction, and configure permissions for the target role according to the permission information corresponding to the target new menu.
9. A permission configuration device, characterized in that: The permission configuration device includes a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute a permission configuration method according to any one of claims 1 to 7 according to instructions in the computer program.
10. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute a permission configuration method according to any one of claims 1 to 7 when executed by a computer processor.
