Page permission configuration method and device, computer equipment and storage medium
By automatically scanning the page source code to obtain interface information and combining access role permissions, automated page permission configuration is realized, solving the problem of low efficiency in manual configuration in the existing technology.
Patent Information
- Application Number
- CN202411461292.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-07
AI Technical Summary
When the prior art prevents users from being vertically overreached, developers need to manually collect the interfaces called by each page and configure the page permissions, which is inefficient.
By obtaining the page source code of the target software, automatically scan and determine the page interface information of the page according to the preset page interface detection rules, and automatically complete the page permission configuration with the interface permission information corresponding to the access role.
No manual configuration is required, which improves the efficiency of page permission configuration and can automatically complete page permission configuration for multiple pages in the target software.
Smart Images

Figure CN119397504A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a page permission configuration method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of software systems, the needs of multi-role users are also being realized on more and more software systems. As a result, more and more web security vulnerabilities have emerged, among which vertical privilege escalation vulnerabilities are security issues that developers and testers are concerned about.
[0003] In order to prevent users from vertically exceeding their authority, it is necessary to determine whether the user has the authority to call the corresponding back-end interface. However, in order to achieve the above-mentioned function of preventing users from vertically exceeding their authority, during the development phase, developers are required to manually collect the interfaces called by each page and manually configure page permissions for different access roles, which results in low efficiency in page permission configuration. Summary of the invention
[0004] The embodiments of the present application provide a page permission configuration method, apparatus, computer equipment and storage medium, which can improve the efficiency of page permission configuration.
[0005] In a first aspect, an embodiment of the present application provides a page permission configuration method, which includes:
[0006] Acquire target software, wherein the target software includes multiple pages;
[0007] For each of the pages, the page source code of the page is scanned according to a preset page interface detection rule to determine the page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page;
[0008] Obtaining interface permission information corresponding to a plurality of access roles respectively, wherein the interface permission information indicates all interfaces to which the corresponding access role has access permissions;
[0009] Based on the page interface information and the interface permission information, the page permission configuration process of each page is performed on each access role to obtain the role page permission information of each access role.
[0010] In a second aspect, the embodiment of the present application further provides a page permission configuration device, which includes:
[0011] A transceiver unit, used to obtain target software, wherein the target software includes a plurality of pages;
[0012] The processing unit is used to scan the page source code of each of the pages according to a preset page interface detection rule to determine the page interface information of the page, wherein the page interface information indicates all interfaces included in the corresponding page; obtain interface permission information corresponding to multiple access roles through the transceiver unit, wherein the interface permission information indicates all interfaces to which the corresponding access role has access rights; based on each of the page interface information and each of the interface permission information, perform page permission configuration processing for each of the pages on each of the access roles to obtain role page permission information for each of the access roles.
[0013] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions can implement the above method when executed by a processor.
[0015] The embodiment of the present application provides a method, device, computer equipment and storage medium for configuring page permissions. Wherein, the method includes: obtaining a target software, the target software includes multiple pages; for each of the pages, scanning the page source code of the page according to a preset page interface detection rule, determining the page interface information of the page, the page interface information indicating all interfaces contained in the corresponding page; obtaining the interface permission information corresponding to multiple access roles, the interface permission information indicating all interfaces that the corresponding access role has access rights; based on each of the page interface information and each of the interface permission information, performing page permission configuration processing on each of the pages for each access role, and obtaining the role page permission information of each access role. The embodiment of the present application automatically obtains the page interface information by scanning the page source code of the page, and automatically completes the page permission configuration of multiple pages in the target software in combination with the interface permission information of each access role, without the need for manual configuration, thereby improving the efficiency of page permission configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a page permission configuration method provided in an embodiment of the present application;
[0018] Figure 2 Another flowchart of the page permission configuration method provided in the embodiment of the present application;
[0019] Figure 3 A schematic block diagram of a page permission configuration device provided in an embodiment of the present application;
[0020] Figure 4 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0023] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0024] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0025] Embodiments of the present application provide a page permission configuration method, apparatus, computer equipment, and storage medium.
[0026] The executor of the page permission configuration method may be the page permission configuration device provided in the embodiment of the present application, or a computer device integrating the page permission configuration device, wherein the page permission configuration device may be implemented in hardware or software, and the computer device may be a terminal or a server.
[0027] Figure 1 Schematic diagram of the page permission configuration method provided by the embodiment of the present application. Figure 1As shown, the method includes the following steps S110-S140.
[0028] S110: Acquire target software, where the target software includes multiple pages.
[0029] In this embodiment, the target software is the software that currently needs to perform page permission configuration, including multiple web pages.
[0030] S120. For each of the pages, scan the page source code of the page according to a preset page interface detection rule to determine page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page.
[0031] In this embodiment, in order to improve the efficiency of obtaining page interfaces, page interface detection rules are set for each page in the target software to automatically scan the page source code of the page and determine the page interface information of the page, wherein the page interface information indicates all interfaces contained in the corresponding page. Specifically, the page interface information includes the interface identifiers of all interfaces contained in the corresponding page, and one page contains one or more interfaces.
[0032] Specifically, the preset page interface detection rule includes a regular expression detection rule and a keyword matching detection rule.
[0033] For example, for regular expression detection rules, when scanning the page source code, the page interface information of the page is determined by searching for interfaces starting with -web / , / workflow, and / metadata / bo / . In addition, in order to prevent the full-text regular matching from being too slow, the application also uses keywords to quickly locate the target characters, and then uses a preset number of characters (such as 1000 characters) before and after the target characters in the page source code as the detection range of the regular expression, thereby reducing the detection range of the regular expression, speeding up the matching and searching speed of the regular expression, reducing the number of regular backtracking times, and speeding up the scanning speed.
[0034] For the keyword matching detection rules, the present application sets special Uniform Resource Locators (URLs) for special nodes (such as query buttons, save buttons, search box queries, and other nodes). The URL formats corresponding to these special nodes are also relatively special, so the present application sets different special node interface keywords for each special node, and scans the special node interfaces through these special node interface keywords.
[0035] In addition, for the keyword matching detection rules, in addition to setting corresponding node interface keywords for special nodes, the present application also pre-sets corresponding general component keywords for the interfaces corresponding to general components.
[0036] It can be seen that this application completes the detection of regular interfaces in the page through regular expression detection rules, and completes the detection of special node interfaces and general component interfaces in the page through keyword matching detection rules, and the interface detection is highly comprehensive.
[0037] In this embodiment, by parsing the pages, the page types of different pages can be identified, such as list pages, detail pages, search pages, etc. There are operations to jump to other pages in the list page, so users who have the list page permission should also have the permission to jump to the sub-page. The interface of the list page also includes the interfaces of each sub-page.
[0038] Therefore, in this embodiment, before determining the page interface information of the page, it is also necessary to obtain the page type of the page. Different page interface information acquisition rules are used for the page types of list pages and other single pages (pages without jump pages, such as detail pages and search pages):
[0039] When the page type is a list page, the list page is used as the parent page, and the child page corresponding to the parent page is determined through the corresponding page source code; the page source code corresponding to the parent page is scanned according to the page interface detection rule to obtain the first page interface information; the second page interface information corresponding to the child page is obtained; the page interface information is determined according to the first page interface information and the second page interface information. That is, the interface corresponding to the page is the interface included in the page and the interface included in the jump page corresponding to the page.
[0040] Furthermore, before scanning the page, the present application counts the interfaces configured by the common components (such as enumeration components, view components, and business components) in the target software, where a common component is configured with one or more interfaces. When scanning the page, if a common component is encountered, the interface of the pre-counted common component can be directly obtained without further scanning the page corresponding to the common component, thereby improving the efficiency of obtaining the page interface.
[0041] At this time, the obtaining of the second page interface information corresponding to the subpage includes:
[0042] Determine whether the sub-page is a page corresponding to a preset general component; if it is a page corresponding to the general component, determine the preset interface information of the target general component corresponding to the sub-page as the second page interface information; if it is not a page corresponding to the general component, scan the page source code corresponding to the sub-page according to the page interface detection rule to obtain the second page interface information.
[0043] Among them, scanning the page source code corresponding to the sub-page according to the page interface detection rules to obtain the second page interface information specifically includes: jumping to the corresponding sub-page by automatically triggering the button corresponding to the corresponding sub-page in the parent page (details button, reused page button or routing button, etc.), and then obtaining the second page interface information by scanning the page source code corresponding to the sub-page.
[0044] In this embodiment, when the parent page is the corresponding page of the workbench, the child page is the jump page of the review form page in the workbench. At this time, the interface acquisition process is relatively fixed. You only need to find all the review forms of the workbench from the workflow service of the corresponding project, and then add the interface of the review form to the corresponding page of the workbench to get the interface corresponding to the workbench page.
[0045] S130: Obtain interface permission information corresponding to a plurality of access roles respectively, wherein the interface permission information indicates all interfaces to which the corresponding access role has access rights.
[0046] In this embodiment, developers need to configure different interface permission information for different access roles. The interface permission information indicates all interfaces to which the corresponding access role has access rights. Specifically, the interface permission information includes interface identifiers of various interfaces accessible to the corresponding access role.
[0047] S140: Based on the page interface information and the interface permission information, perform page permission configuration processing on each access role respectively to obtain role page permission information of each access role.
[0048] In this embodiment, specifically, the page interface information includes the interface identifiers of all interfaces contained in the corresponding page, and the interface permission information includes the interface identifiers of each interface accessible to the corresponding access role. For each access role, if all the interface identifiers in the page interface information of a page are included in the interface permission information corresponding to the access role, the access rights of the page are opened to the access role; otherwise, the access rights of the page are not opened to the access role, and the page interface permission information of each page is polled to complete the page allocation of the access role.
[0049] The obtained role page permission information includes page identifiers of pages that are accessible to the corresponding access role.
[0050] To prevent vertical escaping of user privileges, please refer to Figure 2 After obtaining the role page permission information of each access role, the method further includes steps S210-S290:
[0051] S210 , generating an interface access permission table corresponding to each access role according to the role page permission information of each access role.
[0052] In this embodiment, since the interface permission information of the access role previously obtained may not correspond to the final interface access permission table, such as the target software does not have a certain interface specified in the interface permission information, this application does not directly use the interface permission information as the interface access permission table, but instead generates an interface access permission table corresponding to each access role based on the role page permission information of each access role, so that the generated interface access permission table is more in line with the target software.
[0053] Specifically, the role page permission information includes the page identifier of the page accessible to the corresponding access role. For each access role, the multiple accessible pages are determined by the page identifier in the corresponding role page permission information, and then the interface access permission table is generated based on the interface identifier included in the page interface information of each accessible page.
[0054] S220: Obtain user configuration requests corresponding to a plurality of users, wherein the user configuration requests carry role identifiers corresponding to the respective users.
[0055] S230. In response to the user configuration request, assign access roles corresponding to corresponding role identifiers to each user, and obtain and store corresponding relationships between users and access roles.
[0056] For example, the access role includes an administrator role and a common role. For a company employee, by setting different role identifiers for employees with different roles in a user configuration request, it is determined whether the role corresponding to the employee is an administrator role or a common role.
[0057] S240: Receive an access request from a target user for a target interface.
[0058] In this embodiment, the target user is a user who currently needs to access the target interface, and the target interface is an interface currently accessed by the target user. Specifically, the access request carries a target user identifier and a target interface identifier.
[0059] S250: Determine a target access role corresponding to the target user according to the correspondence between users and access roles.
[0060] Specifically, since the correspondence between users and access roles is previously constructed and stored, when an access request to a target interface from a target user is received, the target access role corresponding to the target user can be determined based on the correspondence.
[0061] S260: Determine a target interface access permission list corresponding to the target access role from interface access permission lists corresponding to a plurality of access roles.
[0062] Specifically, after determining the target access role corresponding to the target user, this embodiment further needs to determine the target interface access permission table corresponding to the target access role from multiple interface access permission tables.
[0063] S270. Determine whether the target user has access rights to the target interface according to the target interface access rights table. If so, execute step S280; if not, execute step S290.
[0064] Specifically, the target interface access permission table stores the interface identifiers of multiple interfaces to which the target user has access rights. If the target interface access permission table stores the target interface identifier carried in the above access request, the target user has access rights to the target interface. Otherwise, the target user does not have access rights to the target interface. Detecting whether the user has access rights to the corresponding interface from the interface dimension can effectively prevent users from vertically exceeding their authority.
[0065] S280: Allow the target user to access the target interface.
[0066] S290: Prohibit the target user from accessing the target interface.
[0067] In summary, the target software is obtained through the present application, and the target software includes multiple pages; for each of the pages, the page source code of the page is scanned according to the preset page interface detection rules to determine the page interface information of the page, and the page interface information indicates all interfaces contained in the corresponding page; the interface permission information corresponding to multiple access roles is obtained, and the interface permission information indicates all interfaces with which the corresponding access role has access rights; based on the page interface information and the interface permission information, the page permission configuration processing of each page is performed on each access role to obtain the role page permission information of each access role. The embodiment of the present application automatically obtains the page interface information by scanning the page source code of the page, and automatically completes the page permission configuration of multiple pages in the target software in combination with the interface permission information of each access role, without the need for manual configuration, thereby improving the efficiency of page permission configuration.
[0068] Figure 3 is a schematic block diagram of a page permission configuration device 300 provided in an embodiment of the present application. Figure 3 As shown, corresponding to the above page permission configuration method, the present application also provides a page permission configuration device 300. The page permission configuration device 300 includes a unit for executing the above page permission configuration method, and the page permission configuration device 300 can be configured in a terminal or a server. Figure 3 The page permission configuration device 300 includes a transceiver unit 301 and a processing unit 302, wherein:
[0069] The transceiver unit 301 is used to obtain the target software, wherein the target software includes multiple pages;
[0070] The target software is the software that currently needs to configure page permissions, including multiple web pages.
[0071] The processing unit 302 is used to scan the page source code of each page according to a preset page interface detection rule to determine the page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page;
[0072] Among them, in order to improve the efficiency of obtaining page interfaces, page interface detection rules are set for each page in the target software to automatically scan the page source code of the page and determine the page interface information of the page, wherein the page interface information indicates all interfaces contained in the corresponding page. Specifically, the page interface information includes the interface identifiers of all interfaces contained in the corresponding page, and one page contains one or more interfaces.
[0073] Specifically, the preset page interface detection rule includes a regular expression detection rule and a keyword matching detection rule.
[0074] The processing unit 302 is further configured to obtain interface permission information corresponding to a plurality of access roles respectively through the transceiver unit 301, wherein the interface permission information indicates all interfaces to which the corresponding access role has access permission;
[0075] The developer needs to configure different interface permission information for different access roles. The interface permission information indicates all interfaces to which the corresponding access role has access rights. Specifically, the interface permission information includes interface identifiers of various interfaces accessible to the corresponding access role.
[0076] The processing unit 302 is further configured to perform page permission configuration processing on each of the pages for each access role based on the page interface information and the interface permission information, so as to obtain the role page permission information of each access role.
[0077] Among them, the page interface information includes the interface identifiers of all interfaces contained in the corresponding page, and the interface permission information includes the interface identifiers of each interface accessible to the corresponding access role. For each access role, if all interface identifiers in the page interface information of a page are included in the interface permission information corresponding to the access role, the access rights of the page are opened to the access role; otherwise, the access rights of the page are not opened to the access role, and the page interface permission information of each page is polled to complete the page allocation of the access role.
[0078] In some embodiments, before executing the step of scanning the page source code of the page according to the preset page interface detection rule to determine the page interface information of the page, the processing unit 302 is further used to:
[0079] Get the page type of the page;
[0080] Among them, different page interface information acquisition rules are used for list pages and other single page types.
[0081] At this time, when the processing unit 302 performs the step of scanning the page source code of the page according to the preset page interface detection rule to determine the page interface information of the page, it is specifically used to:
[0082] When the page type is a list page, the list page is used as the parent page, and the child page corresponding to the parent page is determined through the corresponding page source code; the page source code corresponding to the parent page is scanned according to the page interface detection rule to obtain the first page interface information; the second page interface information corresponding to the child page is obtained; and the page interface information is determined according to the first page interface information and the second page interface information.
[0083] Before scanning the page, the present application pre-counts the interfaces configured by the general components in the target software, where a general component is configured with one or more interfaces. When scanning the page, if a general component is encountered, the pre-counted interfaces of the general component can be directly obtained without further scanning the page corresponding to the general component, thereby improving the efficiency of obtaining the page interface.
[0084] At this time, when the processing unit 302 executes the step of obtaining the second page interface information corresponding to the sub-page, it is specifically used to:
[0085] Determine whether the sub-page is a page corresponding to a preset general component; if it is a page corresponding to the general component, determine the preset interface information of the target general component corresponding to the sub-page as the second page interface information; if it is not a page corresponding to the general component, scan the page source code corresponding to the sub-page according to the page interface detection rule to obtain the second page interface information.
[0086] In some embodiments, after executing the step of performing page permission configuration processing on each access role based on each page interface information and each interface permission information to obtain role page permission information of each access role, the processing unit 302 is further used to:
[0087] Generate an interface access permission table corresponding to each access role according to the role page permission information of each access role.
[0088] Specifically, the role page permission information includes the page identifier of the page accessible to the corresponding access role. For each access role, the multiple accessible pages are determined by the page identifier in the corresponding role page permission information, and then the interface access permission table is generated based on the interface identifier included in the page interface information of each accessible page.
[0089] In some embodiments, after executing the step of performing page permission configuration processing on each access role based on each page interface information and each interface permission information to obtain role page permission information of each access role, the processing unit 302 is further used to:
[0090] The transceiver unit 301 obtains user configuration requests corresponding to multiple users, wherein the user configuration requests carry role identifiers corresponding to each user; in response to the user configuration requests, each user is assigned an access role corresponding to the corresponding role identifier, and the corresponding relationship between the user and the access role is obtained and stored.
[0091] For example, the access role includes an administrator role and a common role. For a company employee, by setting different role identifiers for employees with different roles in a user configuration request, it is determined whether the role corresponding to the employee is an administrator role or a common role.
[0092] In some embodiments, after executing the step of assigning access roles corresponding to corresponding role identifiers to each user in response to the user configuration request, the processing unit 302 is further configured to:
[0093] An access request for a target interface from a target user is received through the transceiver unit 301; a target access role corresponding to the target user is determined according to a correspondence between the user and the access role; a target interface access permission table corresponding to the target access role is determined from interface access permission tables corresponding to a plurality of access roles; whether the target user has access rights to the target interface is determined according to the target interface access permission table; if the target user has access rights to the target interface, the target user is allowed to access the target interface; if the target user does not have access rights to the target interface, the target user is prohibited from accessing the target interface.
[0094] Among them, the target interface access permission table stores the interface identifiers of multiple interfaces to which the target user has access rights. If the target interface access permission table stores the target interface identifier carried in the above-mentioned access request, the target user has access rights to the target interface. Otherwise, the target user does not have access rights to the target interface. Detecting whether the user has access rights to the corresponding interface from the interface dimension can effectively prevent users from vertically exceeding their authority.
[0095] In summary, the target software is obtained through the page permission configuration device 300 provided by the present application, and the target software includes multiple pages; for each of the pages, the page source code of the page is scanned according to the preset page interface detection rules to determine the page interface information of the page, and the page interface information indicates all interfaces contained in the corresponding page; the interface permission information corresponding to multiple access roles is obtained, and the interface permission information indicates all interfaces with which the corresponding access role has access rights; based on the page interface information and the interface permission information, the page permission configuration processing of each page is performed on each access role to obtain the role page permission information of each access role. The embodiment of the present application automatically obtains the page interface information by scanning the page source code of the page, and automatically completes the page permission configuration of multiple pages in the target software in combination with the interface permission information of each access role, without the need for manual configuration, thereby improving the efficiency of page permission configuration.
[0096] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned page permission configuration device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0097] The above-mentioned page permission configuration device can be implemented in the form of a computer program. The computer program can be Figure 4 Runs on the computer device shown.
[0098] See also Figure 4 , Figure 4 4 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 400 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a tablet computer, a laptop computer, a desktop computer, etc. The server may be an independent server or a server cluster composed of multiple servers.
[0099] See also Figure 4 The computer device 400 includes a processor 402 , a memory and a network interface 405 connected via a system bus 401 , wherein the memory may include a non-volatile storage medium 403 and an internal memory 404 .
[0100] The non-volatile storage medium 403 can store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions, and when the program instructions are executed, the processor 402 can execute a page permission configuration method.
[0101] The processor 402 is used to provide computing and control capabilities to support the operation of the entire computer device 400 .
[0102] The internal memory 404 provides an environment for the operation of the computer program 4032 in the non-volatile storage medium 403. When the computer program 4032 is executed by the processor 402, the processor 402 can execute a page permission configuration method.
[0103] The network interface 405 is used to communicate with other devices over the network. Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 400 to which the solution of the present application is applied. The specific computer device 400 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0104] The processor 402 is used to run the computer program 4032 stored in the memory to implement the following steps:
[0105] Acquire target software, wherein the target software includes multiple pages;
[0106] For each of the pages, the page source code of the page is scanned according to a preset page interface detection rule to determine the page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page;
[0107] Obtaining interface permission information corresponding to a plurality of access roles respectively, wherein the interface permission information indicates all interfaces to which the corresponding access role has access permissions;
[0108] Based on the page interface information and the interface permission information, the page permission configuration process of each page is performed on each access role to obtain the role page permission information of each access role.
[0109] It should be understood that in the embodiment of the present application, the processor 402 may be a central processing unit (CPU), and the processor 402 may also be 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. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0110] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0111] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:
[0112] Acquire target software, wherein the target software includes multiple pages;
[0113] For each of the pages, the page source code of the page is scanned according to a preset page interface detection rule to determine the page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page;
[0114] Obtaining interface permission information corresponding to a plurality of access roles respectively, wherein the interface permission information indicates all interfaces to which the corresponding access role has access permissions;
[0115] Based on the page interface information and the interface permission information, the page permission configuration process of each page is performed on each access role to obtain the role page permission information of each access role.
[0116] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0117] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0118] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and 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.
[0119] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0120] 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 storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A page permission configuration method, characterized in that: include: Acquire target software, wherein the target software includes multiple pages; For each of the pages, the page source code of the page is scanned according to a preset page interface detection rule to determine the page interface information of the page, where the page interface information indicates all interfaces included in the corresponding page; Obtaining interface permission information corresponding to a plurality of access roles respectively, wherein the interface permission information indicates all interfaces to which the corresponding access role has access permissions; Based on the page interface information and the interface permission information, the page permission configuration process of each page is performed on each access role to obtain the role page permission information of each access role.
2. The method according to claim 1, characterized in that Before scanning the page source code of the page according to the preset page interface detection rule to determine the page interface information of the page, the method further includes: Get the page type of the page; Scanning the page source code of the page according to the preset page interface detection rule to determine the page interface information of the page includes: When the page type is a list page, the list page is used as a parent page, and the child page corresponding to the parent page is determined through the corresponding page source code; Scan the page source code corresponding to the parent page according to the page interface detection rule to obtain the first page interface information; Obtaining second page interface information corresponding to the subpage; The page interface information is determined according to the first page interface information and the second page interface information.
3. The method according to claim 2, characterized in that The obtaining the second page interface information corresponding to the subpage includes: Determine whether the subpage is a page corresponding to a preset common component; If it is a page corresponding to the general component, the preset interface information of the target general component corresponding to the subpage is determined as the second page interface information; If it is not the page corresponding to the general component, the page source code corresponding to the subpage is scanned according to the page interface detection rule to obtain the second page interface information.
4. The method according to claim 1, characterized in that: The page interface detection rules include regular expression detection rules and keyword matching detection rules.
5. The method according to any one of claims 1 to 4, characterized in that Based on the page interface information and the interface permission information, the page permission configuration processing of each page is performed on each access role respectively, and after obtaining the role page permission information of each access role, the method further includes: Generate an interface access permission table corresponding to each access role according to the role page permission information of each access role.
6. The method according to claim 5, characterized in that Based on the page interface information and the interface permission information, the page permission configuration processing of each page is performed on each access role respectively, and after obtaining the role page permission information of each access role, the method further includes: Obtaining user configuration requests corresponding to a plurality of users, wherein the user configuration requests carry role identifiers corresponding to the respective users; In response to the user configuration request, an access role corresponding to the corresponding role identifier is assigned to each user, and a corresponding relationship between the user and the access role is obtained and stored.
7. The method according to claim 6, characterized in that After allocating access roles corresponding to corresponding role identifiers to each user in response to the user configuration request, the method further includes: receiving an access request from a target user for a target interface; Determining a target access role corresponding to the target user according to a correspondence between users and access roles; Determine a target interface access permission list corresponding to the target access role from interface access permission lists corresponding to a plurality of access roles respectively; Determining whether the target user has access rights to the target interface according to the target interface access rights table; If the target user has access rights to the target interface, allowing the target user to access the target interface; If the target user does not have access rights to the target interface, the target user is prohibited from accessing the target interface.
8. A page permission configuration device, characterized in that: include: A transceiver unit, used to obtain target software, wherein the target software includes a plurality of pages; A processing unit, configured to scan the page source code of each of the pages according to a preset page interface detection rule, and determine the page interface information of the page, wherein the page interface information indicates all interfaces included in the corresponding page; The interface permission information corresponding to multiple access roles is obtained through the transceiver unit, and the interface permission information indicates all interfaces that the corresponding access role has access rights; based on the interface information of each page and the interface permission information of each page, the page permission configuration processing of each access role is performed respectively to obtain the role page permission information of each access role.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the page permission configuration method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the page permission configuration method according to any one of claims 1 to 7.
Citation Information
Cited By
Authority control method and electronic equipment
CN120705898A