A method and terminal for batch granting of user rights

By separating the generation and activation code processes, the inefficiency and error-prone nature of granting permissions to users across levels and in large batches are resolved, achieving efficient and accurate permission management.

CN118364441BActive Publication Date: 2025-12-05FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410548106.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2025-12-05
Estimated Expiration
2044-05-06

AI Technical Summary

Technical Problem

In scenarios involving cross-level and large-volume user authorization, existing technologies for granting user permissions are inefficient and prone to errors, and the operations for administrators are cumbersome.

Method used

By generating user permission activation codes and dividing the process into two stages: generation and activation, the administrator first generates the permission activation code and sends it to the user, who then activates the permissions themselves, reducing the administrator's workload on the system.

Benefits of technology

It improves the efficiency of granting permissions to a large number of users, reduces the error rate, and ensures the accuracy and reliability of permission granting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364441B_ABST
    Figure CN118364441B_ABST
Patent Text Reader

Abstract

The application discloses a method and a terminal for granting user rights in batches, generates a preset number of user right activation codes according to received to-be-authorized information, and then the user activates the right according to the activation code. Therefore, by splitting the authorization of the user into two stages of right code generation and right code activation, in the scenario of needing to grant the user rights in batches, the right activation codes can be generated in batches for the objects to be authorized and the roles to be granted, and then the user activates the right according to the right activation code, so that the right granting efficiency is ensured, the error rate of the right granting is greatly reduced, and the right granting accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of user permission management, and in particular relates to a method for batch granting of user permissions and a terminal. BACKGROUND

[0002] User permission granting is a key function that ensures the security of the system and the integrity of the data. The current user permission granting process is as follows: first, different roles are defined, each role has a specific set of permissions, these roles are defined according to the user's responsibilities in the system and the resources they need to access; second, assign specific permissions to the role, through fine-grained permission control, it can ensure that users can only access the resources they need and limited operations; finally, associate users with roles, assign users to one or more roles, and users obtain access to system resources by inheriting the permissions of the role.

[0003] For the above scheme, in the actual operation process, the administrator needs to notify the user to be granted to register an account in advance, search for the user to be granted (such as by mobile phone number, name, etc.), and then associate it to the role to be granted. These operations have the following disadvantages in cross-level, large-scale authorization scenarios:

[0004] 1) Low efficiency of cross-level authorization in multi-level user permission management

[0005] The administrator needs to notify the user to register on the platform in advance, and collect the user's registration information (search for the user on the platform system through the information). In the case of cross-level, large-scale users, the administrator may not be clear about the cross-level user information, and if the user information is collected incorrectly or not registered, it often needs to be confirmed repeatedly, and the overall authorization process is very low.

[0006] 2) Large amount of work and prone to errors in large-scale user permission granting operation

[0007] The administrator associates the user with a certain role, which is generally done on the user role management interface, searching and adding users under a certain role or searching for roles under the user. In the case of large-scale user authorization, the workload is large and prone to errors. SUMMARY

[0008] The technical problem to be solved by the present application is to provide a method for batch granting of user permissions and a terminal, which can ensure the efficiency and accuracy of permission granting when granting user permissions in large quantities.

[0009] To solve the above technical problems, the technical scheme adopted by the present application is:

[0010] A method for batch granting of user permissions, comprising the steps of:

[0011] S1, generating a preset number of user permission activation codes according to the received to-be-authorized information, obtaining a user permission activation code list, and storing an association relationship between the user permission activation code and the corresponding to-be-authorized information;

[0012] S2, receiving a first activation code uploaded by a first user, if the first activation code exists in the user permission activation code list, storing a first association relationship between a unique identifier of the first user and to-be-authorized information corresponding to the first activation code, and a second association relationship between the unique identifier of the first user and the first activation code.

[0013] To solve the above technical problems, another technical solution adopted by the present application is:

[0014] A terminal for batch granting of user permissions, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for batch granting of user permissions when executing the computer program.

[0015] The present application has the beneficial effect that a preset number of user permission activation codes are generated according to the received to-be-authorized information, and then the user activates the permissions according to the activation code. Therefore, by splitting the user's authorization into two stages of permission code generation and permission code activation, in the scenario of needing to grant a large number of user permissions, permission activation codes can be generated in large quantities for the objects to be authorized and the roles to be granted, and then the user activates the permissions according to the permission activation code, which not only ensures the efficiency of permission granting, but also greatly reduces the error rate of permission granting and ensures the accuracy of permission granting. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 A flowchart of a method for batch granting of user permissions according to an embodiment of the present application;

[0017] Figure 2 A schematic diagram of a terminal for batch granting of user permissions according to an embodiment of the present application;

[0018] Figure 3 A flowchart of generation of a permission activation code according to an embodiment of the present application;

[0019] Figure 4 A flowchart of activation of a permission activation code according to an embodiment of the present application;

[0020] Figure 5 A module relationship diagram of a method for batch granting of user permissions according to an embodiment of the present application;

[0021] Label explanation:

[0022] 1. A terminal for batch granting of user rights; 2. a memory; 3. a processor. DETAILED DESCRIPTION

[0023] To illustrate the technical content, the purposes and effects of the present application, the following embodiments are described in conjunction with the accompanying drawings.

[0024] Please refer to Figure 1 The embodiment of the present application provides a method for batch granting of user rights, comprising the steps of:

[0025] S1. Generating a preset number of user right activation codes according to the received to-be-authorized information, obtaining a user right activation code list, and storing the association relationship between the user right activation code and the corresponding to-be-authorized information;

[0026] S2. Receiving a first activation code uploaded by a first user, if the first activation code exists in the user right activation code list, storing a first association relationship between the unique identifier of the first user and the to-be-authorized information corresponding to the first activation code, and a second association relationship between the unique identifier of the first user and the first activation code.

[0027] From the above description, the beneficial effects of the present application are that a preset number of user right activation codes are generated according to the received to-be-authorized information, and then the user activates the right according to the activation code. Therefore, by splitting the user's authorization into two stages of right code generation and right code activation, in the scenario of needing to grant a large number of user rights, the right activation code can be generated in large quantities for the objects to be authorized and the roles to be granted, and then the user activates the right according to the right activation code. In this way, the efficiency of right granting is ensured, and the error rate of right granting is greatly reduced, and the accuracy of right granting is ensured.

[0028] Further, before step S1, it includes:

[0029] Receiving to-be-authorized information, the to-be-authorized information including a to-be-authorized object list and a to-be-granted role list, if the information of the to-be-authorized object in the to-be-authorized object list is the object information already existing in the database, and the information of the to-be-granted role in the to-be-granted role list is the role information already existing in the database, then step S1 is executed, otherwise, an exception prompt information is returned.

[0030] From the above description, before batch granting of user rights, it is checked whether the to-be-authorized object and the to-be-granted role are all compliant information, so as to ensure the reliability of the entire right granting process.

[0031] Further, in step S1, the preset number of user right activation codes are generated according to the received to-be-authorized information, including:

[0032] generate a preset number of user permission activation codes for each to-be-authorized object in the to-be-authorized information;

[0033] When each user permission activation code is generated, it is determined whether the generated user permission activation code is unique, if yes, the next user permission activation code is generated until the number of user permission activation codes corresponding to the to-be-authorized object reaches the preset number, if no, the current user permission activation code is re-generated.

[0034] As can be seen from the above description, after generating an activation code that has not appeared and is unique, the activation code is associated with the to-be-authorized information, and the next activation code is generated after the activation code is associated and stored in the database, so that the uniqueness of the generated activation code is ensured.

[0035] Further, in step S2, if the first activation code exists in the user permission activation code list, the following steps are further included:

[0036] It is determined whether the first activation code is not activated and not expired, if no, a prompt information that the first activation code is invalid is returned.

[0037] As can be seen from the above description, for the activated or expired activation code, in order to avoid repeated authorization, authorization conflict or abnormal authorization, the prompt information that the first activation code is invalid is returned, so that the reliability of batch user authorization is ensured.

[0038] Further, in step S2, the following steps are further included:

[0039] If the first activation code does not exist in the user permission activation code list, the prompt information that the first activation code is invalid is returned.

[0040] Please refer to Figure 2 Another embodiment of the present application provides a terminal for granting user permission in batches, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements each step of the above-mentioned method for granting user permission in batches when executing the computer program.

[0041] The above-mentioned method and terminal for granting user permission in batches are suitable for granting user permission in large quantities, and ensure the efficiency and accuracy of permission granting, which will be described below through specific embodiments:

[0042] Embodiment one

[0043] Please refer to Figure 1 , Figures 3 to 5 A method for granting user permission in batches comprises the following steps:

[0044] The authorization information to be authorized is received by the permission activation code generation module, and the authorization information to be authorized includes a list of objects to be authorized and a list of roles to be granted. If the information of the object to be authorized in the list of objects to be authorized is the existing object information in the database, and the information of the role to be granted in the list of roles to be granted is the existing role information in the database, step S1 is executed, otherwise, an abnormal prompt information is returned.

[0045] In this embodiment, the list of objects to be authorized includes the ID and type of the authorized object, and the list of roles to be granted includes the resource name. In this embodiment, the number of activation codes to be generated is also required to be received and verified for its legality, that is, whether the number of activation codes to be generated is within the number setting interval. If yes, it is recorded as legal, otherwise, it is recorded as illegal.

[0046] S1, generate a preset number of user permission activation codes according to the received authorization information to be authorized, obtain a list of user permission activation codes, and store the association relationship between the user permission activation code and the corresponding authorization information to be authorized.

[0047] Among them, a preset number of user permission activation codes are generated for each object to be authorized in the authorization information; when each user permission activation code is generated, it is judged whether the currently generated user permission activation code is unique. If yes, the next user permission activation code is generated, until the number of user permission activation codes corresponding to the object to be authorized reaches the preset number, if not, the current user permission activation code is regenerated.

[0048] Specifically, according to the character set collection, a 16-bit activation code that has not appeared and is unique is randomly generated, the activation code is associated with the authorization information to be authorized, and the next activation code is generated after the association of the activation code and the storage in the database, so as to ensure the uniqueness of the generation of the activation code.

[0049] In this embodiment, it is assumed that the authorized object includes a region a and a region b, the ID of the region a is id_a, and the type is area; the ID of the region b is id_b, and the type is area. The role list includes a teacher training administrator yx_role, and the type is role; a region administrator qy_role, and the type is role. At this time, if the generated activation code of the region a object is auth_code, the following is stored in the association table:

[0050] auth_code, area, id_a

[0051] auth_code, role, qy_role

[0052] auth_code, role, yx_role

[0053] When each to-be-authorized object in the to-be-authorized information generates a preset number of user permission activation codes, and the activation codes are all associated, a user permission activation code list is returned.

[0054] S2, receiving a first activation code uploaded by a first user, if the first activation code exists in the user permission activation code list, storing a first association relationship between a unique identifier of the first user and first activation code corresponding to-be-authorized information, and a second association relationship between the unique identifier of the first user and the first activation code.

[0055] Specifically, in the permission activation code activation module, if the first activation code exists in the user permission activation code list, it is further judged whether the first activation code is not activated and not expired, if it is activated or expired, a prompt information that the first activation code is invalid is returned, if it is not activated and not expired, a first association relationship between the unique identifier of the first user and the first activation code corresponding to-be-authorized information is stored, and a second association relationship between the unique identifier of the first user and the first activation code is stored.

[0056] If the first activation code does not exist in the user permission activation code list, a prompt information that the first activation code is invalid is returned.

[0057] Specifically, as shown in Figure 4 When the first user activates through the first activation code, the first activation code uploaded by the first user is received, the activation code detail information is queried in the user permission activation code list according to the first activation code, if the query fails, a prompt information that the activation code is invalid is returned; if the query succeeds, it is verified whether the activation code information is expired or activated, if yes, a prompt information that the activation code is invalid is returned, otherwise, the userid of the user is obtained, the association relationship between the to-be-authorized object and the to-be-granted role associated with the activation code of the user userid is stored, and the association relationship between the user userid and the activation code is stored.

[0058] Embodiment two

[0059] The main difference between this embodiment and embodiment one is that a specific application scenario is provided:

[0060] A provincial educational administrator needs to grant 50 teachers in A district and B district of a city the permission of class management and student performance management.

[0061] Step 11, in the background permission activation code generation interface, the region object list selects A district and B district, and the role list selects the class management and student performance management role.

[0062] Step 12, the permission activation code generation interface parameter, for each region object batch generation of a predetermined number of permission activation code, wherein according to the preset number of activation code for A and B area are generated a predetermined number of activation code, specific:

[0063] Step 12.1, according to the region object system exists in the region, check the role list is the system has existed role. If the check fails, return an exception prompt information.

[0064] Step 12.2, according to the character set collection, randomly generate 16 bit activation code code, query whether the database has the activation code code, if it exists, continue to generate activation code code, until the database can't find the generated activation code code.

[0065] Step 12.3, the database stores the association between the permission activation code code and the authorization information and the expiration time.

[0066] Step 12.4, complete step 12.2 and step 12.3 in turn until the predetermined number is reached.

[0067] Step 12.5, return the permission activation code list information.

[0068] A provincial educational administrator exports the batch generated activation code information, and sends the exported permission activation code file to a city administrator after encryption. A city administrator sends the permission activation code to the teacher who needs to be authorized through relevant channels (such as email, WeChat, QQ, etc.).

[0069] After receiving the permission activation code, the teacher activates the permission activation code and obtains the corresponding permission.

[0070] Step 21, log in to the system (the teacher needs to register in advance), enter the permission activation code activation interface, and input the permission activation code for activation.

[0071] Step 22, the permission activation code activation interface receives the permission activation code parameter and activates:

[0072] Step 22.1, according to the permission activation code code, query the activation code detail information, if not found, return an exception prompt information.

[0073] Step 22.2, check the activation code information, if it has expired or has been activated, return the response error information.

[0074] Step 22.3, get the userid of the user from the interface authentication information, query the permission information associated with the permission activation code from the database; store the association between userid and permission information in the database.

[0075] Step 22.4, store the association between the activation code and the user.

[0076] The provincial educational administrator can also enter the activation code management interface to check the activation information of the activation code, such as the activation progress or the user information of the activated activation code.

[0077] Embodiment three

[0078] Please refer to Figure 2 A terminal 1 for granting user rights in batches, comprising a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3, wherein the processor 3 implements each step of the method for granting user rights in batches according to the embodiments one or two when executing the computer program.

[0079] In summary, the method and terminal for granting user rights in batches provided by the present application split the authorization of the user into two stages: permission code generation and permission code activation. The administrator focuses on the issuance of permissions and sends the generated permission code to the user to be authorized through a corresponding channel (which can be an offline channel or an online channel such as email, WeChat, QQ, etc.). The user to be authorized activates the activation code independently to obtain the corresponding permissions after receiving the activation code.

[0080] In other solutions in the prior art, the administrator does not need to collect user information in advance and bind the user to a role on the platform system. In particular, in the authorization scenario of a large number of users in multiple levels, the administrator needs to collect the user in advance and bind the user on the system, which often requires multiple rounds of repetition (such as the user may not be registered, needs to be notified to register, the user collection information is incorrect, etc.), and the efficiency is very low. In the present application, the cumbersome and inefficient operation of binding the user to a role is issued to the user through the activation code, and the user activates to obtain the authorization information independently, without the need for the administrator to operate on the platform system.

[0081] The above is only an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent transformation or direct or indirect application in related technical fields based on the content of the specification and drawings of the present application is also included in the patent protection scope of the present application.

Claims

1. A method of bulk granting of permissions to a user, characterized by, The method comprises the steps of: S1, generating a preset number of user permission activation codes according to the received to-be-authorized information, obtaining a user permission activation code list, and storing an association relationship between the user permission activation code and the corresponding to-be-authorized information; S2, receiving a first activation code uploaded by a first user, if the first activation code exists in the user permission activation code list, storing a first association relationship between a unique identifier of the first user and to-be-authorized information corresponding to the first activation code, and a second association relationship between the unique identifier of the first user and the first activation code; In step S1, the generating of the preset number of user permission activation codes according to the received to-be-authorized information comprises: generating a preset number of user permission activation codes for each to-be-authorized object in the to-be-authorized information; when each user permission activation code is generated, it is judged whether the currently generated user permission activation code is unique, if yes, the next user permission activation code is continuously generated until the number of user permission activation codes corresponding to the to-be-authorized object reaches the preset number, if not, the current user permission activation code is re-generated.

2. The method of claim 1, wherein, Before step S1, it comprises: receiving to-be-authorized information, the to-be-authorized information comprising a to-be-authorized object list and a to-be-granted role list, if the information of the to-be-authorized object in the to-be-authorized object list is the object information already existing in the database, and the information of the to-be-granted role in the to-be-granted role list is the role information already existing in the database, step S1 is executed, otherwise, an abnormal prompt information is returned.

3. The method of claim 1, wherein, In step S2, if the first activation code exists in the user permission activation code list, the following steps are further included: judging whether the first activation code is not activated and not expired, if not, a prompt information that the first activation code is invalid is returned.

4. The method of claim 1, wherein, In step S2, the following steps are further included: if the first activation code does not exist in the user permission activation code list, a prompt information that the first activation code is invalid is returned.

5. A terminal for bulk granting of user rights, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the following steps are implemented: S1, generating a preset number of user permission activation codes according to the received to-be-authorized information, obtaining a user permission activation code list, and storing an association relationship between the user permission activation code and the corresponding to-be-authorized information; S2, receiving a first activation code uploaded by a first user, if the first activation code exists in the user permission activation code list, storing a first association relationship between a unique identifier of the first user and to-be-authorized information corresponding to the first activation code, and a second association relationship between the unique identifier of the first user and the first activation code; In step S1, the generating of the preset number of user permission activation codes according to the received to-be-authorized information comprises: generating a preset number of user permission activation codes for each to-be-authorized object in the to-be-authorized information; when each user permission activation code is generated, it is judged whether the currently generated user permission activation code is unique, if yes, the next user permission activation code is continuously generated until the number of user permission activation codes corresponding to the to-be-authorized object reaches the preset number, if not, the current user permission activation code is re-generated.

6. The terminal of claim 5, wherein, Before step S1, it comprises: Receiving to-be-authorized information, the to-be-authorized information including a to-be-authorized object list and a to-be-granted role list, if information of a to-be-authorized object in the to-be-authorized object list is object information already existing in the database and information of a to-be-granted role in the to-be-granted role list is role information already existing in the database, executing step S1, otherwise, returning an abnormal prompt information.

7. The terminal of claim 5, wherein, In step S2, if the first activation code exists in the user permission activation code list, then the step S2 further includes: Judging whether the first activation code is not activated and not expired, if not, returning a prompt information that the first activation code is invalid.

8. The terminal of claim 5, wherein, In step S2, the step S2 further includes: If the first activation code does not exist in the user permission activation code list, then returning a prompt information that the first activation code is invalid.

Citation Information

Patent Citations

  • Batch off-line activation method, batch on-line activation method and batch on-line activation system of operating system

    CN114880648A

  • Permission granting method and system and readable storage medium

    CN116861466A