Request sending method and device, storage medium and electronic equipment
By receiving and verifying user login requests, dynamically generating permission lists, and performing permission verification when users access requests, the problem of insufficient static and refined permission management in the existing technology is solved, and dynamic permission management of user roles and business needs is realized to ensure information security.
Patent Information
- Application Number
- CN202411873594.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, permission management relies on static permission allocation methods, cannot automatically update changes with user roles or business needs, and cannot accurately reach specific operations or data access points.
By receiving a login request from the target user, verifying his/her identity and generating a permission list based on his/her role, including the target resource structure and access interface that matches the role. Show the user the permission list, and when the user sends an access request, determine whether his access permission is in the permission list, and if so, forward the request to the destination web page.
Dynamic permission management is realized to ensure that users access the correct resources according to their roles and permissions, protect system resources from unauthorized access, and achieve the goal of information security.
Smart Images

Figure CN119835022A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a request sending method and device, a storage medium, and an electronic device. Background Art
[0002] With the emergence of a large number of websites, users have a large number of resource access requirements when visiting websites. For example, after logging into a website, users need to access the website's files, databases, interfaces and other resources to obtain the required information.
[0003] In existing network access control technologies, website access control relies on the authorization of access requests, that is, the website server determines whether to respond to the access request based on the permissions of the received access request. If the user does not have permission, the website server will not respond to the access request. Traditional permission management systems use a static permission allocation method. Once the setting is completed, unless manually adjusted, the permissions will not be automatically updated as the user role or business needs change. In addition, in many systems, permission management is coarse-grained according to functional modules, and cannot be accurate to specific operations or data access points. Summary of the invention
[0004] The embodiments of the present application provide a request sending method and device, a storage medium, and an electronic device to at least solve the problem of permission management in the related art.
[0005] According to an embodiment of the present application, a request sending method is provided, which is applied to a permission management device, wherein the permission management device is connected to a target web page, and comprises: receiving a login request sent by a target user, wherein the login request is used to request to log in to the target web page, and the login request includes the login information of the target user; responding to the login request, and in a case where it is determined according to the login information of the target user that the identity authentication of the target user is passed, generating a permission list for the target user according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure; displaying the permission list to the target user, and receiving an access request sent by the target user, wherein the access request is used to request to access a target resource in the target web page; in a case where it is determined that the access right of the target resource is in the permission list, sending the access request to the target web page to instruct the target web page to respond to the access request and send the target resource to the target user.
[0006] In an exemplary embodiment, the permission management device includes a resource management component, an interface operation component and a role management component. Before receiving a login request sent by a target user, the method further includes: setting a resource structure set of the permission management device through the resource management component, wherein the resource structure set includes a function menu of multiple resource structures, the function menu includes a function of allowing resource interaction with the target web page, and the target resource structure is a resource structure in the resource structure set; setting a plurality of access interface sets of the resource structures through the interface operation component, wherein the access interface set includes multiple access interfaces, the target access interface is an interface among the multiple access interfaces, and the access interface is an interface for resource interaction with the target web page; generating a role permission set through the role management component, wherein the role permission set includes permissions of multiple roles, and the permissions of the roles include permissions allowing resource interaction with the target web page.
[0007] In an exemplary embodiment, the permission management device also includes a user management component, which is connected to the resource management component, the interface operation component, and the role management component. In response to the login request, when it is determined that the identity authentication of the target user is passed according to the login information of the target user, a permission list of the target user is generated according to the target role assigned to the target user, including: when it is determined that the identity authentication of the target user is passed according to the login information of the target user, the permission list of the target user is generated by the user management component, wherein the user management component generates the permission list of the target user through the following steps: searching the role of the target user from a role database to obtain the target role, wherein the role included in the role database is data generated by the management user in the permission management device according to the user's registration information; searching the resource structure matching the role from the resource structure set to obtain the target resource structure; searching the access interface matching the target resource structure from the access interface set to obtain the target access interface; associating the target resource structure and the target access interface to obtain the permission list.
[0008] In an exemplary embodiment, in response to the login request, after determining that the target user's identity authentication has passed based on the target user's login information, and generating a permission list for the target user based on the target role assigned to the target user, the method further includes: receiving a permission modification request sent by a management user, wherein the permission modification request is used to request modification of the permission list, and the permission modification request includes the management user's login information; in response to the modification request, after determining that the management user's identity authentication has passed based on the management user's login information, displaying the permission list in a display interface in the permission management device; and in response to the management user's modification operation on the permission list in the display interface, obtaining a first target permission list.
[0009] In an exemplary embodiment, the permission management device includes a display module, and the displaying of the permission list to the target user and receiving an access request sent by the target user include: sending the permission list to the display module, so that the permission list is converted into a list in a preset format through the display module to obtain a second target permission list; generating a permission menu according to the second target permission list through the display module, and setting an operation control in the permission menu; rendering the permission menu and the operation control to display the permission menu and the operation control in a user interface included in the permission management device, or displaying a target link that allows the target user to access the permission menu and the operation control through the user interface; and receiving the access request generated by the target user performing a trigger operation on the operation control or on the target link.
[0010] In an exemplary embodiment, when it is determined that the access rights of the target resource are in the permission list, the access request is sent to the target web page to instruct the target web page to respond to the access request and send the target resource to the target user, including: parsing the access request to determine the user ID of the target user and the target role from the access request; when the permissions of the user ID and the target role are both in the permission list, encapsulating the access request to obtain a target access request; and sending the target access request to the target web page through the target access interface.
[0011] In an exemplary embodiment, after presenting the permission list to the target user and receiving an access request sent by the target user, the method further includes: generating an access response message when it is determined that the access rights to the target resource are not in the permission list; and displaying the access response message in a user interface included in the permission management device.
[0012] According to another embodiment of the present application, a request sending device is provided, which is applied to a permission management device, and the permission management device is connected to a target web page, and the device includes: a first receiving module, which is used to receive a login request sent by a target user, wherein the login request is used to request to log in to the target web page, and the login request includes the login information of the target user; a first responding module, which is used to respond to the login request, and when it is determined according to the login information of the target user that the identity authentication of the target user is passed, generates a permission list for the target user according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure; a first display module, which is used to display the permission list to the target user and receive an access request sent by the target user, wherein the access request is used to request to access a target resource in the target web page; a first sending module, which is used to send the access request to the target web page when it is determined that the access right of the target resource is in the permission list, so as to instruct the target web page to respond to the access request and send the target resource to the target user.
[0013] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0014] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0015] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0016] Through this application, since the login request contains the login information of the target user, the rights management device can verify the identity of the user by verifying the login information. Once the user identity authentication is passed, the rights management device generates a permission list according to the role of the target user. When the rights management device determines that the access rights of the target resource are in the permission list, it will forward the access request to the target web page. It can ensure that users access the correct resources according to their roles and permissions, while protecting system resources from unauthorized access, and achieving the information security goals of the enterprise. Therefore, the problem of rights management in the related art can be solved, and the effect of effectively managing the rights of users to access web resources can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a hardware structure block diagram of a server device of a request sending method according to an embodiment of the present application;
[0018] Figure 2 is a flowchart of a request sending method according to an embodiment of the present application;
[0019] Figure 3 is a flowchart of the authority verification of the authority management device of this specific embodiment;
[0020] Figure 4 It is a structural block diagram of a request sending device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a request sending method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the request sending method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0026] In this embodiment, a request sending method is provided, which is applied to a rights management device, wherein the rights management device is connected to a target web page. Figure 2 is a flowchart of a request sending method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0027] Step S202, receiving a login request sent by a target user, wherein the login request is used to request to log in to the target webpage, and the login request includes login information of the target user;
[0028] Optionally, this embodiment includes but is not limited to being applied to any enterprise-level application or platform that requires user authentication and fine-grained permission management. For example, in an enterprise's internal management system, such as a human resources management system, a financial management system, a project management system, etc., employees need to access different modules to complete their work. The internal systems of institutions such as banks, insurance, and securities ensure that only authorized employees can access sensitive customer information or conduct financial transactions, and record all operations at the same time to facilitate audits and compliance checks. The electronic medical record system of a hospital ensures that medical staff in different positions (such as doctors, nurses, and pharmacists) can only access patient information related to their work, and record all access records at the same time, in compliance with medical industry data protection regulations such as HIPAA. The backend management system of an e-commerce platform ensures that merchants can only view and manage their own orders and products, customers cannot access backend data, and platform administrators can monitor and manage the operation of the entire platform. In all these scenarios, the core principle of this embodiment is to use the Spring Security framework to implement dynamic permission allocation and fine-grained access control, which can significantly enhance the security of the system while improving management efficiency and user experience. Among them, the Spring Security framework is a subproject of the Spring family. It is a powerful security framework specifically designed to protect Java-based Web applications from security threats. Spring Security provides comprehensive security services, including authentication, authorization, session management, encryption, CSRF (cross-site request forgery) protection, security configuration, login and logout functions, etc., which can meet the security needs of most Web applications.
[0029] Optionally, the target user in this embodiment refers to a user who needs to access the system or a specific webpage, and may be any user who has registered or needs to pass identity authentication to obtain access rights.
[0030] Optionally, the login request in this embodiment is a request sent by the target user to the system by providing login information (such as user name and password) for the purpose of verifying his identity and obtaining permission to access the system.
[0031] Optionally, the login information in this embodiment is the credentials used by the user to log into the system, usually including a user name and password, and may also include other identity authentication information, such as a SMS verification code for two-factor authentication, biometric data, etc.
[0032] Optionally, the target webpage in this embodiment is a specific webpage or system resource that the user requests to access, and may be an operation interface of an internal enterprise application, such as an "employee information management" page.
[0033] Step S204, in response to the login request, if it is determined according to the login information of the target user that the identity authentication of the target user is passed, generating a permission list of the target user according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure;
[0034] Optionally, the identity authentication in this embodiment can be a process of confirming the identity of the user by checking the login information provided by the user. For example, the Spring Security framework is used as a core component for performing identity authentication, which can handle various authentication mechanisms such as password verification, OAuth2, OpenID Connect, etc.
[0035] Optionally, the target role in this embodiment is the role assigned to the target user in the system, and the role defines the set of permissions of the user in the system. For example, Zhang San may be assigned the role of "senior administrator", while Li Si may be assigned the role of "ordinary user".
[0036] Optionally, the permission list in this embodiment is a list dynamically generated based on the role of the target user, which describes in detail the resources and operations that the user can access. The permission list may include resource identifiers, operation types (such as read, write, execute, etc.) and resource access interface information.
[0037] Optionally, the resource structure in this embodiment is a form in which the resources in the system are organized according to functions or hierarchical structures. The resource structure may be a tree structure, in which the top-level node is a resource module (such as "user management"), and the child nodes are specific resources (such as "user information viewing").
[0038] Optionally, the target access interface in this embodiment is a specific API or method call related to the target resource structure, and users access and operate resources through these interfaces. For example, a "user information viewing" resource may correspond to a RESTful API named / api / user / info.
[0039] Step S206, displaying the permission list to the target user, and receiving an access request sent by the target user, wherein the access request is used to request access to a target resource in the target webpage;
[0040] Optionally, the access request in this embodiment is a request initiated by the target user through clicking, submitting a form or other interactive methods, and is intended to access specific resources in the system or perform specific operations.
[0041] Step S208: When it is determined that the access permission of the target resource is in the permission list, the access request is sent to the target webpage to instruct the target webpage to respond to the access request and send the target resource to the target user.
[0042] Through the above steps, since the login request contains the login information of the target user, the rights management device can verify the identity of the user by verifying the login information. Once the user identity authentication is passed, the rights management device generates a permission list according to the role of the target user. When the rights management device determines that the access rights of the target resource are in the permission list, it will forward the access request to the target web page. It can ensure that the user accesses the correct resources according to their roles and permissions, while protecting system resources from unauthorized access, and achieving the information security goals of the enterprise. Therefore, the problem of rights management in the related art can be solved, and the effect of effectively managing the user's rights to access web resources can be achieved.
[0043] In a specific embodiment, for example, assume that there is an enterprise-level project management software, which includes multiple modules such as "project information management", "personnel allocation" and "progress tracking", and each module has several specific functions. Specifically, the following steps are included:
[0044] Step S302, Zhang San tries to log in to the project management software, and he enters his user name "zhangsan" and password. Zhang San's login request is sent to the authority management device.
[0045] Step S304, after receiving the login request from Zhang San, the rights management device uses the Spring Security framework to perform identity authentication. Assuming that Zhang San's login information is correct, the rights management device generates a rights list based on Zhang San's role (in this example, assuming that Zhang San is the "project manager" role). The rights list includes the resource structure that Zhang San can access (such as all functions under the "project information management" module) and the target access interface (such as / api / project / info, / api / project / assign, etc.).
[0046] Step S306: The permission list is sent to the front end, which dynamically generates a user interface based on the permission list, displaying the function menu and operation buttons that Zhang San can access. Zhang San sees the "Project Information Management" menu item on the front end and clicks "View Project Details". The front end captures this click event and encapsulates it into an access request, which includes the identifier of the target resource (such as the project ID).
[0047] Step S308, the rights management device receives Zhang San's access request and checks whether the target resource of the request (i.e., the "view project details" function) is in Zhang San's permission list. Assuming that the "view project details" function belongs to the "project information management" module, and Zhang San's "project manager" role has the right to access all functions under this module, then the permission check passes. The rights management device forwards the access request to the target web page (in this embodiment, it is the back-end service of the project management software), the back-end service processes the request, retrieves the project details from the database, and returns the data to the front end through the RESTful API response, and the front end displays the project details to Zhang San.
[0048] Through the above specific embodiments, the security access permission control system based on Spring Security ensures that users can only access resources within their role permissions, while providing a safe, efficient and flexible permission control mechanism, which helps to maintain the security and compliance of the system.
[0049] In an exemplary embodiment, the permission management device includes a resource management component, an interface operation component and a role management component. Before receiving a login request sent by a target user, the method further includes: setting a resource structure set of the permission management device through the resource management component, wherein the resource structure set includes a function menu of multiple resource structures, the function menu includes a function of allowing resource interaction with the target web page, and the target resource structure is a resource structure in the resource structure set; setting a plurality of access interface sets of the resource structures through the interface operation component, wherein the access interface set includes multiple access interfaces, the target access interface is an interface among the multiple access interfaces, and the access interface is an interface for resource interaction with the target web page; generating a role permission set through the role management component, wherein the role permission set includes permissions of multiple roles, and the permissions of the roles include permissions allowing resource interaction with the target web page.
[0050] Optionally, the resource management component in this embodiment is an important part of the rights management device, which is used to define and maintain the resource structure in the entire system. The resource structure can be regarded as a functional map of the system, which organizes all accessible resources (such as pages, API interfaces, data, etc.) into a tree structure or list, making resource management more orderly and clear. The resource management component includes functions such as creating, editing, deleting, and querying resources, and can dynamically configure the visibility and operation permissions of resources.
[0051] Optionally, the interface operation component in this embodiment is the access interface of each resource in the resource structure set. The access interface is the method or way provided by the system to other external or internal components to access resources, which is a RESTful API, SOAP service or other type of service interface. The interface operation component is responsible for defining and managing these interfaces, including the URL of the interface, request method (such as GET, POST), interface parameters and other information, as well as the calling permissions of these interfaces.
[0052] Optionally, the role management component in this embodiment is used to define and manage the roles of the system and the permission sets associated with these roles. Roles can be understood as an abstraction of user permissions, and different roles have different permission sets. The role management component allows system administrators to dynamically create, edit, and delete roles, and assign or cancel role permissions. These permissions are associated with resources in the resource structure set or interfaces in the access interface set to form a role permission set, thereby implementing role-based access control.
[0053] For example, suppose there is an internal project management platform of an enterprise, whose permission management device includes a resource management component, an interface operation component and a role management component. The specific operation includes the following steps:
[0054] Step S402, configure resource structure: the system administrator defines the resource structure set of the platform through the resource management component. For example, under the "project management" resource structure, there are sub-resource structures such as "project list", "project details", "project editing", and "project deletion". Each resource structure defines its display method on the front-end interface (such as menu items, buttons) and its resource identifier on the back-end (such as URL).
[0055] Step S404, set access interface: The interface operation component is used to define the access interface set that matches the resource structure in the resource structure set. For example, the access interface corresponding to the "project details" resource structure may be / api / project / {projectId}, where {projectId} is a dynamic parameter in the URL path that is used to identify a specific project. The interface operation component also defines the calling permissions for each interface. For example, only users with the "project manager" and "senior administrator" roles can call the "project deletion" API interface.
[0056] Step S406, creating roles and assigning permissions: Through the role management component, the administrator creates roles such as "project manager", "project member", "senior administrator", and defines corresponding permission sets for each role. For example, the "project manager" role may be granted access rights to all resources under the "project management" resource structure, while the "project member" role may only have the permissions of "project view" and "task submission".
[0057] Step S408, user login and authority allocation: A user (such as Zhang San) attempts to log in to the project management platform and enters his user name and password. The identity authentication component in the authority management device verifies Zhang San's identity. Once the verification is passed, the role management component generates a permission list based on Zhang San's role. This list contains all resource structures and corresponding access interfaces that Zhang San can access.
[0058] Step S410, user access request processing: After logging in, Zhang San tries to access the "Project Details" page, and the interface operation component in the permission management device checks whether this request is in Zhang San's permission list. Since Zhang San's "Project Manager" role has access rights to the "Project Details" resource, the request is forwarded to the target web page (i.e., the backend service of the project management platform), and the backend service retrieves the project details according to the request parameters and returns the information to the front end for Zhang San to view.
[0059] Through this embodiment, the permission management device defines the resource structure through the resource management component, defines the access interface through the interface operation component, and creates roles and assigns permissions through the role management component, thereby jointly building a secure and flexible permission management system to ensure that each user can only access resources within the permissions of his or her role, thereby improving the security of the system and the protection of data.
[0060] In an exemplary embodiment, the permission management device also includes a user management component, which is connected to the resource management component, the interface operation component, and the role management component. In response to the login request, when it is determined that the identity authentication of the target user is passed according to the login information of the target user, a permission list of the target user is generated according to the target role assigned to the target user, including: when it is determined that the identity authentication of the target user is passed according to the login information of the target user, the permission list of the target user is generated by the user management component, wherein the user management component generates the permission list of the target user through the following steps: searching the role of the target user from a role database to obtain the target role, wherein the role included in the role database is data generated by the management user in the permission management device according to the user's registration information; searching the resource structure matching the role from the resource structure set to obtain the target resource structure; searching the access interface matching the target resource structure from the access interface set to obtain the target access interface; associating the target resource structure and the target access interface to obtain the permission list.
[0061] Optionally, the user management component in this embodiment is a key module in the rights management device, which is used for the creation, maintenance, query of user accounts and verification of user identities. It is closely connected with other components (resource management component, interface operation component, role management component) to ensure the synchronization of user information and rights logic. The user management component also includes the association logic between users and roles, and can generate a rights list according to the user's role.
[0062] Optionally, the role database in this embodiment is a data storage for storing user role information, which can be a relational database, a NoSQL database, or any other type of data storage system. The role information of each user in the system is recorded in the role database, including the user ID, the role ID and its association, and the role's permission information. The role database is crucial for implementing role-based access control.
[0063] Optionally, the permission list in this embodiment is generated according to the role assigned to the user, and contains a detailed list of resource structures that the user can access and access interfaces that can be called. The permission list ensures the corresponding relationship between the user's access rights and system resources, and is the basis for user access control.
[0064] For example, suppose that on an internal development platform of a technology company, there are the following users: Zhang San (project manager), Wang Wu (project member), and Li Si (system administrator). The following are steps for how the permission management device generates a permission list for Zhang San through the user management component:
[0065] Step S502, user login verification: Zhang San tries to log in to the development platform and submits his username and password. The identity verification component in the rights management device uses the Spring Security framework to verify Zhang San's login information. Assuming that Zhang San's login information is correct, the identity verification is passed.
[0066] Step S504, role search: the user management component searches for the role information of Zhang San from the role database according to his user ID. In this embodiment, Zhang San is assigned the role of "project manager".
[0067] Step S506, resource structure search: the user management component obtains the entire resource structure set from the resource management component, and then filters out all resource structures associated with the "project manager" role, such as "project list", "project details", "task assignment" and other resource structures under "project management".
[0068] Step S508, access interface search: the interface operation component searches for a corresponding access interface set according to the resource structure information provided by the user management component. For example, the access interfaces matching the "project details" resource structure include / api / project / detail and / api / project / task.
[0069] Step S510, permission list generation: The user management component associates the target resource structure with the target access interface to generate a permission list for Zhang San. The permission list records in detail the resource structures that Zhang San can access and their corresponding access interfaces. For example, the permission list may include: {"resource":" / project / list","methods":["GET"],"description":"View project list"}, {"resource":" / project / detail","methods":["GET"],"description":"View project details"}, {"resource":" / project / task","methods":["POST","GET"],"description":"Assign tasks and view task lists"}, etc.
[0070] Step S512, once the permission list is generated, Zhang San can access the corresponding resources and interfaces according to his permission list, but cannot access resources not covered by the permission list. For example, Zhang San can access the project list and project details page, but cannot access the "system settings" related interface, because this exceeds the permission scope of the "project manager" role and belongs to the permission of the "system administrator" role.
[0071] This embodiment ensures the consistency and security of user access control by showing that the user management component confirms the user's identity based on the user's login information, then searches for role information from the role database, and further generates a detailed permission list from the resource structure set and the access interface set. Through this process, not only can unauthorized access be prevented, but users can also be ensured to perform only operations permitted by their roles, thereby protecting the system's data security and the integrity of business processes.
[0072] In an exemplary embodiment, in response to the login request, after determining that the target user's identity authentication has passed based on the target user's login information, and generating a permission list for the target user based on the target role assigned to the target user, the method further includes: receiving a permission modification request sent by a management user, wherein the permission modification request is used to request modification of the permission list, and the permission modification request includes the management user's login information; in response to the modification request, after determining that the management user's identity authentication has passed based on the management user's login information, displaying the permission list in a display interface in the permission management device; and in response to the management user's modification operation on the permission list in the display interface, obtaining a first target permission list.
[0073] Optionally, the permission modification request in this embodiment is initiated by a management user (a role with permission to modify permissions) in the system to request to modify the permission list of the target user. This usually involves operations such as adjusting a user's role, adding or deleting accessible resources, or changing the access interface permissions of resources.
[0074] Optionally, the management user in this embodiment is a user with advanced permissions, who can perform operations such as user management, role management, resource management, and permission modification. The management user is usually a system administrator, security administrator, or a senior person with management permissions, who is responsible for ensuring the correctness and security of system permission settings.
[0075] Optionally, the display interface in this embodiment is an interface provided by the permission management device for viewing and managing the permission list, which can be a web interface, a mobile application interface, or a desktop application interface. The display interface generally includes functions such as display, search, filter, add, delete, and modify the permission list, so that the management user can intuitively manage permissions.
[0076] Optionally, the first target permission list in this embodiment is a new permission list generated after modifying the current permission list of the target user. This includes adding new permissions, canceling old permissions, or adjusting the level of permissions. The first target permission list reflects the modified access rights of the target user, ensuring that the user can only access and operate resources within their newly assigned permissions.
[0077] For example, suppose Zhang San (project manager) has a set of permission lists on the internal development platform of a technology company, and Li Si (system administrator) needs to modify Zhang San's permissions. Here are the specific steps:
[0078] Step S602, management user login: As a system administrator, Li Si attempts to log in to the authority management device and submits his login information (including username and password) as a management user. The identity authentication component uses the Spring Security framework to verify Li Si's login information and confirm his administrator identity.
[0079] Step S604, display of permission list: After Li Si logs in, the user management component of the permission management device responds to Li Si's permission modification request and displays the permission list of all current users. Li Si finds Zhang San's permission list in the display interface and can see all of Zhang San's resource structures and access interface permissions, such as "project management", "task allocation", "project details" and other resource structures and their corresponding interfaces.
[0080] Step S606, modifying the permission list: Li Si decides to adjust Zhang San's permission so that he can access the "system settings" resource structure but cannot access the sensitive "user information management" function. Li Si modifies Zhang San's permission list on the display interface, checks the "system settings" resource structure and cancels the permission of the "user information management" resource structure.
[0081] Step S608, generating the first target permission list: the user management component responds to Li Si's modification operation and generates the first target permission list of Zhang San. This new list contains Zhang San's adjusted access rights, such as adding access rights to the "system settings" related interface and canceling access to the "user information management" related functions.
[0082] Step S610, permission update: After Li Si confirms the modification operation, the permission management device updates the permission database and replaces Zhang San's permission list with the first target permission list. This means that the next time Zhang San logs in, the system will control his access to resources according to the first target permission list, ensuring that the update of the permission setting takes effect immediately.
[0083] The rights management device of this embodiment allows the management user to view and modify the rights list of the target user through the rights modification request after confirming that the identity authentication is passed. It provides the flexibility of rights management and ensures the security and real-time nature of rights modification, which helps to maintain the security of the system and meet the changes in business needs.
[0084] In an exemplary embodiment, the permission management device includes a display module, and the displaying of the permission list to the target user and receiving an access request sent by the target user include: sending the permission list to the display module, so that the permission list is converted into a list in a preset format through the display module to obtain a second target permission list; generating a permission menu according to the second target permission list through the display module, and setting an operation control in the permission menu; rendering the permission menu and the operation control to display the permission menu and the operation control in a user interface included in the permission management device, or displaying a target link that allows the target user to access the permission menu and the operation control through the user interface; and receiving the access request generated by the target user performing a trigger operation on the operation control or on the target link.
[0085] Optionally, the display module in this embodiment is a core component in the rights management device, which is used to display the rights management information on the user interface in a user-friendly manner. It can process the rights list, convert it into a preset format, and generate a rights menu and operation controls so that the target user can intuitively understand his or her rights in the system and access these rights through the operation controls.
[0086] Optionally, the list in the preset format (second target permission list) in this embodiment is the result of formatting the permission list according to the configuration of the permission management device or the standard template, which may group the permissions according to resource structure, type, function, or add visual elements such as icons and color coding to improve the readability and access efficiency of the information. The second target permission list is the form of the permission list after conversion in the display module.
[0087] Optionally, the permission menu in this embodiment is a menu list or tree structure generated by the display module, which includes all resources and functions that the target user can access. The permission menu may be designed to be foldable so that the user can easily navigate to a specific resource structure or access interface.
[0088] Optionally, the operation control in this embodiment is an interactive element such as a button, link, or drop-down menu in the permission menu or on the resource page, through which the target user can perform specific operations, such as viewing resource details, editing resources, creating new resources, etc. The design of the operation control must ensure that only operations within the scope of the target user's authority are activated to prevent unauthorized operations.
[0089] Optionally, the user interface in this embodiment is an interface for the target user to interact with the rights management device, which may be a web interface, a desktop application interface, or a mobile application interface. The user interface not only displays the rights menu and operation controls, but may also include other functional elements such as user information, system notifications, search boxes, help documents, etc., to provide a complete user experience.
[0090] Optionally, the target link in this embodiment is a link in the user interface for accessing a specific resource or performing a specific operation. When the target user does not have the authority to directly access the access rights menu, the rights management device may allow the target user to perform certain operations within a restricted scope by displaying the target link. The design of the target link must ensure that the resource or operation it points to is within the authority of the target user.
[0091] For example, suppose that in an enterprise-level project management software, Zhang San (project manager) has the permissions to view "project details", "task assignments" and "project progress tracking". The following are the steps for the display module to process Zhang San's permission list and generate a permission menu:
[0092] Step S702, permission list conversion: The permission list generated by the user management component is sent to the display module. The display module converts the permission list into a list in a preset format. This process may include grouping the permission list by resource structure, adding icons and descriptions, and applying color coding to distinguish different types of resources and operation permissions. The formatted permission list is called the second target permission list.
[0093] Step S704, generating a permission menu: the display module generates a permission menu using the second target permission list. The permission menu may be presented as a tree menu on the left, which includes various resource structures under the "project management" resource module, such as "project details", "task allocation" and "project progress tracking". Under each resource structure, relevant operation controls or links may be listed, such as buttons or links such as "edit project" and "assign task".
[0094] Step S706, operation control setting: the display module sets operation controls in the permission menu, which are visible and operable only to target users with corresponding permissions. For example, Zhang San can see and use the "Edit Project" button, while users without "Edit Project" permission cannot see this button.
[0095] Step S708, user interface rendering: the display module renders the permission menu and operation controls and displays them on the user interface of the software. The user interface may also include other elements, such as a search box, a user information area, system notifications, etc., to provide a complete user experience.
[0096] Step S710, receiving access request: Zhang San clicks the "Edit Project" button on the user interface, triggering an access request. The interface operation component in the rights management device receives the request, checks Zhang San's rights list, and after confirming that Zhang San has the "Edit Project" rights, forwards the request to the corresponding backend service, which processes the request and returns the corresponding data or performs the corresponding operation.
[0097] This embodiment ensures that the target user can clearly see his or her permissions through the display module, and can only access and operate resources within the scope of his or her permissions through the permission menu and operation controls, thereby enhancing the security of the system and the transparency of permission management.
[0098] In an exemplary embodiment, when it is determined that the access rights of the target resource are in the permission list, the access request is sent to the target web page to instruct the target web page to respond to the access request and send the target resource to the target user, including: parsing the access request to determine the user ID of the target user and the target role from the access request; when the permissions of the user ID and the target role are both in the permission list, encapsulating the access request to obtain a target access request; and sending the target access request to the target web page through the target access interface.
[0099] Optionally, the access rights of the target resource in this embodiment refer to the rights of a specific user to access or operate a certain resource. In rights management, each resource (such as a page, function, data, etc.) has a corresponding access right setting, which is recorded in a rights list to control user access to resources.
[0100] Optionally, the user identification in this embodiment is an identifier used by the system to uniquely identify the user, which may be a user name, user ID, email address, mobile phone number, etc. The user identification is used to authenticate the user when logging in, and to identify the source of the user request in subsequent operations.
[0101] Optionally, the target role in this embodiment refers to the role currently played by the user determined by the system when the user requests to access a resource. A user may have multiple roles at the same time, but in a certain request, a target role is usually determined based on the priority of the role to determine whether the user has the authority to access the target resource. The target role may be included in the user ID, permission list or request header.
[0102] Optionally, the permission list in this embodiment is generated by the system for each user, and includes a permission set of all roles of the user. The permission list is dynamically generated, reflects the access rights currently possessed by the user, and is the basis for whether the user can access specific resources.
[0103] Optionally, the encapsulated access request (target access request) in this embodiment refers to converting the original access request into a request containing user identification, target role and target resource permission information. The target access request usually contains additional fields or parameters for permission verification in the target web page or backend service.
[0104] For example, suppose that in a project management platform based on Spring Security, Zhang San (project manager) tries to access the "Project Details" page. The following are the specific steps for the system to process Zhang San's access request:
[0105] Step S802, access request parsing: When Zhang San clicks the "Project Details" link or button, the client (such as a web browser or mobile application) sends an HTTP request to the project management platform. After receiving this request, the rights management device first parses the access request and extracts the user identifier (for example, Zhang San's user ID or username) and the target role (for example, "project manager") in the HTTP request header. This process may be completed by the request parsing filter in the filter chain of Spring Security.
[0106] Step S804, authority verification: the authority management device checks the authority list to determine whether Zhang San's user ID and the "project manager" role have the authority to access the "project details" page. The authority list may be stored in memory or obtained from a database in real time to ensure the real-time and accuracy of the authority.
[0107] Step S806, encapsulate the access request: After the authority verification confirms that Zhang San has the authority to access the "Project Details" page, the authority management device encapsulates the original access request and adds additional fields or parameters, such as user identification, target role and access token (such as JWT) to the request. This encapsulated request is called a target access request.
[0108] Step S808, sending a target access request: The authority management device sends the target access request to the target webpage (i.e., the backend service of the project management platform) through the target access interface (such as / api / project / {projectId} / detail). After receiving the target access request, the backend service will verify the validity of the user ID, target role, and access token again to ensure the legitimacy and security of the request.
[0109] Step S810, target web page response: After the backend service verification is passed, the target access request is processed, the project details information corresponding to the target project ID is retrieved from the database, and this information is packaged into the corresponding data format (such as JSON), and sent back to the client through the HTTP response, and finally the "Project Details" page is displayed on Zhang San's user interface.
[0110] The rights management device of this embodiment can ensure that users can safely and legally access resources within their authority by parsing, verifying, and encapsulating access requests, and forwarding the requests to the target webpage through the target access interface. It effectively prevents unauthorized users from accessing sensitive data or performing sensitive operations, and ensures the security of the system and the integrity of data.
[0111] In an exemplary embodiment, after presenting the permission list to the target user and receiving an access request sent by the target user, the method further includes: generating an access response message when it is determined that the access rights to the target resource are not in the permission list; and displaying the access response message in a user interface included in the permission management device.
[0112] Optionally, the access response message in this embodiment is a message generated when the rights management device determines that the target user does not have permission to access a specific resource. This is an error prompt or access denial notification, informing the user that they cannot access the requested resource. The access response message may contain the reason for the access denial, guidance on how to apply for the required permissions, or information about relevant contacts, etc., to help the user understand the situation and take appropriate action. The user interface in this case is the interface through which the user interacts with the rights management device, which can be a web interface, desktop client, or mobile application interface. When permission verification fails, the user interface is responsible for displaying the access response message, informing the user that they do not have permission to access a specific resource, and may also provide some additional user guidance or help information.
[0113] For example, suppose that in an enterprise-level project management software, Zhang San (project manager) has the permission to view "project details", "task assignments" and "project progress tracking", but does not have access to the "financial report" resource. The following are the specific steps to handle Zhang San's attempt to access the "financial report":
[0114] Step S902, access "Financial Report" request: Zhang San attempts to click on the "Financial Report" menu or link on the user interface of the project management software to send an access request. After receiving the request, the rights management device parses the request and attempts to determine Zhang San's user ID and target role.
[0115] Step S904, authority verification: the authority management device checks Zhang San's authority list to determine whether the access permission of the "financial report" resource is included in it. In this example, the authority list does not include the access permission of the "financial report".
[0116] Step S906, generate an access response message: Since the permission list does not include access rights to "financial reports", the permission management device generates an access response message, which is usually an error prompt or access denial notification, for example: "You do not have permission to access financial reports, please contact the system administrator to obtain more permissions."
[0117] Step S908, displaying the access response message on the user interface: The rights management device sends the access response message to the user interface and displays the message on the interface that Zhang San is using. The display method may be a pop-up window, a red warning bar, or directly displaying an access denied icon and text at the requested menu location. This immediate feedback helps prevent users from repeatedly trying to access unauthorized resources and provides clear guidance information.
[0118] Optionally, if Zhang San wants to apply for permission to access "Financial Reports" after receiving the access denied prompt, he can perform the following operations through the user interface:
[0119] Permission application function: The user interface may provide a permission application button or link. When the user sees a prompt that access is denied, the user can click this button or link to enter the permission application process.
[0120] Permission application form: The permission application function may guide Zhang San to fill out a permission application form, which includes the reason for the application, the specific resources that need to be accessed, and Zhang San’s contact information, etc. Through this form, Zhang San can clearly express his needs to the system administrator or security team.
[0121] Permission application approval: After Zhang San submits the permission application, the system automatically sends the application to the designated approver, who may be a system administrator or a member of the security team. The approver will review the application and consider whether to grant Zhang San access to the "Financial Report" and details such as the scope and validity period of the permission.
[0122] Permission update and notification: Once the permission application is approved, the permission management device will update Zhang San's permission list and add the access permission of "Financial Report". At the same time, the system will inform Zhang San through email or system notification function of the user interface that his permission has been updated and he can now access the "Financial Report" resource.
[0123] The rights management device of this embodiment provides clear feedback when access is denied, and supports the process of user application and update of rights, thereby ensuring the flexibility of rights control and the security of the system.
[0124] The present application is described below in conjunction with specific embodiments:
[0125] This specific embodiment is explained by taking the control of user rights by the rights management device as an example. In this specific embodiment, the rights management device adopts a back-end service based on Spring Boot and Spring Security, and a front-end service based on Vue3 to form a user rights management system with front-end and back-end separation. This system includes resource modules (corresponding to the resource management components mentioned above), resources (corresponding to the interface operation components mentioned above), roles (corresponding to the role management components mentioned above) and users (corresponding to the user management components mentioned above). Through dynamic rights configuration, precise control of user rights is achieved. Among them, the resource module is a menu bar, and the resources are actual operation buttons. Roles are associated with resources, and users are associated with roles. In this way, precise control of user rights can be achieved.
[0126] The configuration of each module in the rights management device includes:
[0127] Resource module definition: In the system management center, the administrator defines multiple resource modules, such as "project management", "quality inspection", "security center", etc. Each resource module corresponds to a menu bar and supports a tree structure to facilitate user navigation.
[0128] Resource definition: Under the "Security Center" resource module, resources such as "Security Incident Maintenance" are defined, corresponding to the actual functional operation interface.
[0129] Role definition and permission association: Created the "Security Management Center Administrator" role and associated it with all resources under the "Security Center" resource module, such as "Security Incident Management".
[0130] User definition and role association: The user "Zhang San" is created and assigned the "Security Management Center Administrator" role.
[0131] Spring Security framework integration: The backend service integrates the Spring Security framework for user authorization authentication and interface request permission verification, ensuring that only users with corresponding permissions can access specific resources and perform specific operations.
[0132] Dynamic configuration of permissions: The administrator adjusted the permissions of the "Security Management Center Administrator" role through the System Management Center and cancelled the access permission for "Security Incident Maintenance".
[0133] In addition, the rights management device also supports custom configuration of the menu bar on the front-end page. Administrators can dynamically adjust the content and structure of the menu bar according to actual needs without modifying the code, which improves the flexibility and maintainability of the system. The following is an explanation of how to implement dynamic configuration of the menu bar:
[0134] Enter all menu bars of the system into the system; create corresponding roles according to requirements, and associate the menu bars that you want the role to have access to with the role; create users, and associate the roles you want to assign to the users with the users; the system interface that the user can see when logging into the system. For example, in the system interface, the user has the role of "Security Management Center Administrator", and this role includes all menus under the "Security Center" menu bar. If the requirements change and the user is not allowed to see the "Security Incident Maintenance" menu, return to the above steps and uncheck the menu bar under the role.
[0135] Take user authentication and interface request permission verification as an example to illustrate. Figure 3 FIG. 1 is a flowchart of the permission verification of the permission management device of this specific embodiment, which includes the following steps:
[0136] S3302: Start the authority management device: When the authority management device is started, the system will perform the following operations to ensure that all role permissions and resource mapping relationships are loaded correctly for subsequent operations.
[0137] Load role permission data: read all roles and their associated permission information from a preconfigured database. This data is usually stored in a relational database (such as MySQL) or a key-value store (such as Redis), and the role permission information involved includes role ID, role name, associated permission list, etc. For example, the database stores the "project manager" role, and the permissions associated with this role include "view project details", "assign tasks", "approve budget", etc. The permission management device reads this information from the database at startup and loads it into memory for quick access.
[0138] Load resource mapping: Get the mapping relationship between all resources (such as pages, API interfaces) and permissions from the configuration file. The configuration file may be in JSON, XML or YAML format, and contain information such as resource identifiers, resource types, and associated permission IDs. For example, the configuration file defines the mapping between the " / project / {id} / detail" interface and the "View project details" permission, ensuring that only users with the "View project details" permission can access the detailed information of a specific project.
[0139] Startup completed: After all role permissions and resource mapping data are loaded, the permission management device completes startup and enters standby state, ready to receive and process user login requests and interface access requests.
[0140] S3304: User login: When a user attempts to log in to the authority management device, the system will execute corresponding verification processes according to different login methods to ensure the legitimacy and security of the user's identity.
[0141] Login with username and password: The user enters the username and password, and the permission management device uses the SpringSecurity framework for identity authentication. If the username and password are correct and the maximum number of errors is within the limit, the system will generate a token containing the user's role information and permission list. For example, Zhang San enters his username and password, and the system verifies that he is a legitimate "project manager" role user and generates a token containing Zhang San's role and permission information.
[0142] SMS verification login: The user enters the mobile phone number, and the system sends a text message containing a verification code. The user enters the received verification code on the login interface, and the permission management device verifies the validity of the verification code. If the verification code is correct, the system generates a token. For example, Li Si chooses SMS verification to log in. After entering his mobile phone number, he receives a verification code "123456". He enters the verification code and passes the verification, and the system generates a token for him.
[0143] Username, password, verification code two-factor authentication login: a combination of username, password and verification code for dual authentication. After the user enters the username and password, the system sends a verification code to the user's registered email or mobile phone, and the user needs to enter the verification code to complete the verification. This method improves the security of login and is suitable for systems with high security levels. For example, Wang Wu selected two-factor authentication when logging in. After entering the username and password, he received a verification code "7890" in the email. After he entered the verification code, the authority management device confirmed his identity and generated a token.
[0144] Regardless of the login method used, if the credentials are verified correctly and the maximum number of errors is not exceeded, the system will generate a token. The token stores the user's identity information and permission list, and subsequent interface requests will rely on this token for user authentication and authorization verification.
[0145] S3306: Accessing the system interface after logging in: After the user logs in to the authority management device, each time the user attempts to access a system interface, the system will execute the following process to ensure the legality and security of the access.
[0146] User authentication: When the permission management device receives an interface access request, it first parses the token in the request to determine the initiator of the request and the role permissions it has. For example, after Zhang San logs in, he tries to access the " / project / {id} / detail" interface. The permission management device parses the token and confirms that Zhang San has the "view project details" permission.
[0147] Authentication: After the user is authenticated, the system checks whether the requested interface is in the user's permission list and whether the user has the permission to perform the operation. For example, after Zhang San's token is parsed, the authentication process confirms that Zhang San's "Project Manager" role does have permission to access the "View Project Details" interface, so access is allowed.
[0148] Interface call and result return: After authentication, the permission management device forwards the request to the corresponding backend service, which processes the request and returns the corresponding result information to the user. For example, after the authentication process is passed, Zhang San's request is forwarded to the project management service, which queries the database and returns the project details to Zhang San, which is displayed on the front-end interface.
[0149] Through the above process, the permission management device ensures that only legitimate users can access the system interface within the scope of permission, which enhances the security of the system, and verifies the user identity in multiple ways when the user logs in, which improves the security level of the system. At the same time, the use of tokens simplifies the subsequent interface request process and makes permission verification more efficient.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0151] In this embodiment, a request sending device is also provided, which is applied to the rights management device, and the rights management device is connected to the target webpage. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions have been made no further. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0152] Figure 4 is a structural block diagram of a request sending device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0153] A first receiving module 42 is used to receive a login request sent by a target user, wherein the login request is used to request to log in to the target webpage, and the login request includes the login information of the target user;
[0154] A first response module 44 is used to respond to the login request, and when it is determined that the identity authentication of the target user is passed according to the login information of the target user, generate a permission list of the target user according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure;
[0155] A first display module 46, used to display the permission list to the target user and receive an access request sent by the target user, wherein the access request is used to request access to a target resource in the target webpage;
[0156] The first sending module 48 is used to send the access request to the target webpage when it is determined that the access permission of the target resource is in the permission list, so as to instruct the target webpage to respond to the access request and send the target resource to the target user.
[0157] In an exemplary embodiment, the permission management device includes a resource management component, an interface operation component and a role management component. Before receiving a login request sent by a target user, the device further includes: a first setting module, used to set a resource structure set of the permission management device through the resource management component, wherein the resource structure set includes a function menu of multiple resource structures, the function menu includes a function of allowing resource interaction with the target web page, and the target resource structure is a resource structure in the resource structure set; a second setting module, used to set an access interface set of multiple resource structures through the interface operation component, wherein the access interface set includes multiple access interfaces, the target access interface is an interface among the multiple access interfaces, and the access interface is an interface for resource interaction with the target web page; a first generation module, used to generate a role permission set through the role management component, wherein the role permission set includes permissions of multiple roles, and the permissions of the roles include permissions allowing resource interaction with the target web page.
[0158] In an exemplary embodiment, the permission management device also includes a user management component, which is connected to the resource management component, the interface operation component, and the role management component. The first response module includes: a first generation unit, which is used to generate a permission list for the target user through the user management component when it is determined that the identity authentication of the target user is passed according to the login information of the target user, wherein the user management component generates the permission list for the target user through the following steps: a first search unit, which is used to search the role of the target user from a role database to obtain the target role, wherein the role included in the role database is data generated by the management user in the permission management device according to the user's registration information; a second search unit, which is used to search the resource structure matching the role from the resource structure set to obtain the target resource structure; a third search unit, which is used to search the access interface matching the target resource structure from the access interface set to obtain the target access interface; a first association unit, which is used to associate the target resource structure with the target access interface to obtain the permission list.
[0159] In an exemplary embodiment, the above-mentioned device also includes: a second receiving module, used to respond to the login request, and after determining that the identity authentication of the target user is passed according to the login information of the target user, generating the permission list of the target user according to the target role assigned to the target user, receiving a permission modification request sent by the management user, wherein the permission modification request is used to request modification of the permission list, and the permission modification request includes the login information of the management user; a second response module, used to respond to the modification request, and after determining that the identity authentication of the management user is passed according to the login information of the management user, displaying the permission list in the display interface of the permission management device; a third response module, used to respond to the modification operation performed by the management user on the permission list in the display interface to obtain a first target permission list.
[0160] In an exemplary embodiment, a first display module includes: a first sending unit, used to send the permission list to the display module, so that the permission list is converted into a list in a preset format through the display module to obtain a second target permission list; a second generating unit, used to generate a permission menu according to the second target permission list through the display module, and set an operation control in the permission menu; a first rendering unit, used to render the permission menu and the operation control, so as to display the permission menu and the operation control in a user interface included in the permission management device, or to display a target link that allows the target user to access the permission menu and the operation control through the user interface; a first receiving unit, used to receive the access request generated by the target user performing a trigger operation on the operation control or on the target link.
[0161] In an exemplary embodiment, a first sending module includes: a first parsing unit, used to parse the access request to determine the user ID of the target user and the target role from the access request; a first encapsulation unit, used to encapsulate the access request to obtain a target access request when the permissions of the user ID and the target role are both in the permission list; and a second sending unit, used to send the target access request to the target web page through the target access interface.
[0162] In an exemplary embodiment, the above-mentioned device also includes: a second generation module, which is used to display the permission list to the target user, and after receiving the access request sent by the target user, if it is determined that the access rights of the target resource are not in the permission list, generate an access response message; a display unit, which is used to display the access response message in a user interface included in the permission management device.
[0163] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0164] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0165] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0166] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0167] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0168] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0169] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0170] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0171] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0172] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0173] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A request sending method, characterized in that: Applied to a rights management device, the rights management device is connected to a target webpage, the method comprises: Receiving a login request sent by a target user, wherein the login request is used to request to log in to the target webpage, and the login request includes login information of the target user; In response to the login request, if it is determined according to the login information of the target user that the identity authentication of the target user is passed, a permission list of the target user is generated according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure; Displaying the permission list to the target user, and receiving an access request sent by the target user, wherein the access request is used to request access to a target resource in the target webpage; In the case where it is determined that the access permission of the target resource is in the permission list, the access request is sent to the target webpage to instruct the target webpage to respond to the access request and send the target resource to the target user.
2. The method according to claim 1, characterized in that: The rights management device includes a resource management component, an interface operation component and a role management component. Before receiving a login request sent by a target user, the method further includes: Setting a resource structure set of the authority management device through the resource management component, wherein the resource structure set includes a function menu of multiple resource structures, the function menu includes a function of allowing resource interaction with the target webpage, and the target resource structure is a resource structure in the resource structure set; Setting a plurality of access interface sets of the resource structures through the interface operation component, wherein the access interface set includes a plurality of access interfaces, the target access interface is an interface among the plurality of access interfaces, and the access interface is an interface for performing resource interaction with the target web page; A role permission set is generated through the role management component, wherein the role permission set includes permissions of multiple roles, and the permissions of the roles include permissions for allowing resource interaction with the target webpage.
3. The method according to claim 2, characterized in that The authority management device further includes a user management component, which is connected to the resource management component, the interface operation component, and the role management component, and responds to the login request. When it is determined according to the login information of the target user that the identity authentication of the target user is passed, a permission list of the target user is generated according to the target role assigned to the target user, including: When it is determined according to the login information of the target user that the identity authentication of the target user is passed, the user management component generates a permission list of the target user, wherein the user management component generates the permission list of the target user through the following steps: Searching for the role of the target user from a role database to obtain the target role, wherein the roles included in the role database are data generated by a management user in the authority management device according to the user's registration information; Searching for a resource structure matching the role from the resource structure set to obtain the target resource structure; Searching for an access interface matching the target resource structure from the access interface set to obtain the target access interface; The target resource structure and the target access interface are associated to obtain the permission list.
4. The method according to claim 1, characterized in that: In response to the login request, when it is determined according to the login information of the target user that the identity authentication of the target user is passed, after generating a permission list of the target user according to the target role assigned to the target user, the method further includes: Receiving a permission modification request sent by a management user, wherein the permission modification request is used to request modification of the permission list, and the permission modification request includes login information of the management user; In response to the modification request, when it is determined according to the login information of the management user that the identity authentication of the management user is passed, displaying the permission list in a display interface in the permission management device; In response to the management user performing a modification operation on the permission list in the display interface, a first target permission list is obtained.
5. The method according to claim 1, characterized in that The permission management device includes a display module, and the step of displaying the permission list to the target user and receiving an access request sent by the target user includes: Sending the permission list to the display module, so that the permission list is converted into a list in a preset format through the display module to obtain a second target permission list; Generate a permission menu according to the second target permission list by the display module, and set an operation control in the permission menu; Rendering the permission menu and the operation control to display the permission menu and the operation control in a user interface included in the permission management device, or displaying a target link that allows the target user to access the permission menu and the operation control through the user interface; The access request generated by the target user performing a triggering operation on the operation control or the target link is received.
6. The method according to claim 1, characterized in that In the case where it is determined that the access permission of the target resource is in the permission list, sending the access request to the target webpage to instruct the target webpage to respond to the access request and send the target resource to the target user, including: Parsing the access request to determine the user identifier of the target user and the target role from the access request; If the user identifier and the target role's permissions are both in the permission list, encapsulate the access request to obtain a target access request; The target access request is sent to the target webpage through the target access interface.
7. The method according to claim 1, characterized in that After presenting the permission list to the target user and receiving an access request sent by the target user, the method further includes: If it is determined that the access permission of the target resource is not in the permission list, generating an access response message; The access response message is displayed in a user interface included in the authority management device.
8. A request sending device, characterized in that: Applied to a rights management device, the rights management device is connected to a target web page, and the device comprises: A first receiving module, configured to receive a login request sent by a target user, wherein the login request is used to request to log in to the target webpage, and the login request includes login information of the target user; A first response module is used to respond to the login request, and when it is determined that the identity authentication of the target user is passed according to the login information of the target user, generate a permission list of the target user according to the target role assigned to the target user, wherein the permission list includes a target resource structure matching the role of the target user and a target access interface of the target resource structure; A first display module, used to display the permission list to the target user, and receive an access request sent by the target user, wherein the access request is used to request access to a target resource in the target webpage; The first sending module is used to send the access request to the target webpage when it is determined that the access permission of the target resource is in the permission list, so as to instruct the target webpage to respond to the access request and send the target resource to the target user.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic 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 steps of the method described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Enterprise internal management authority control method and system based on RBAC model
CN121093325A