Method, device and equipment for automatically generating page authority and storage medium
Patent Information
- Application Number
- CN202211003364.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-08-19
AI Technical Summary
[0003]目前的权限设置方法,可以手动录入权限相关标识到数据库中,但是手动操作工作量较大,同时较为繁琐
[0037]本申请实施例提供的页面权限自动生成方法,在创建页面时,可以自动生成页面和功能按键的权限允许标识,避免了用户手动设置,降低出错率,以及减少直接修改页面主体标签代码的工作量,提高前端页面的权限控制效率。
Smart Images

Figure CN115455328B_ABST
Abstract
Claims
1. A method for automatically generating page permissions, characterized in that, include: Construct a function key dictionary, which contains the tags and attribute values corresponding to the function keys whose permissions are to be configured. When creating a page, a page permission permission identifier is generated, including: generating a page permission permission permission identifier based on the page's JSON data and mounting it to the root node of the JSON; and obtaining the function keys for the permissions to be configured corresponding to the page, including: recursively traversing the JSON tree of the page, determining whether the JSON object at the current level contains a function key corresponding to a preset behavior type; if it contains a function key corresponding to the preset behavior type, obtaining the label of the function key; matching the label of the function key with the labels of function keys for the permissions to be configured in the function key dictionary, and if the match is successful, the function key is determined to be a function key for the permissions to be configured; after traversal, all function keys for the permissions to be configured corresponding to the page are obtained. The attribute value of the function key corresponding to the permission to be configured on the page is retrieved according to the function key dictionary. The page permission permission permission identifier is concatenated with the attribute value to obtain the permission permission permission identifier of the function key to be configured.
2. The method according to claim 1, characterized in that, The preset behavior types include pop-ups, sending requests, and page redirects.
3. The method according to any one of claims 1 to 2, characterized in that, After obtaining the permission permission identifier of the function key whose permission to be configured is obtained, the following is also included: Store the page permission permission identifier and the function key permission permission identifier in the resource permission table; When writing permission-related interface routes in the backend, the interface routes are generated based on the page permission permission identifier and the function button permission permission identifier in the resource permission table, and a common path is added to the path for matching during permission verification.
4. The method according to any one of claims 1 to 2, characterized in that, After obtaining the permission permission identifier of the function key whose permission to be configured is obtained, the following is also included: Get the resource permission data of the currently accessing user; Obtain the permission permission identifier for the page to be accessed based on the JSON data of the page to be accessed; Parse the resource permission data of the accessing user and determine whether there is a permission permission identifier for the page to be accessed in the resource permission data; If the resource permission data contains a permission permission identifier for the page to be accessed, then the user is allowed to access the page.
5. The method according to any one of claims 1 to 2, characterized in that, After obtaining the permission permission identifier of the function key whose permission to be configured is obtained, the following is also included: Retrieve resource permission data corresponding to the accessing user; Obtain the permission permission identifier corresponding to the interface to be accessed based on the route to the interface to be accessed; Parse the resource permission data of the accessing user and determine whether there is a permission permission identifier for the interface to be accessed in the resource permission data; If the resource permission data contains a permission permission identifier for the interface to be accessed, then the user is allowed to call that interface data.
6. An automatic page permission generation device, characterized in that, include: A construction module is used to build a function key dictionary, which contains the tags and attribute values corresponding to the function keys whose permissions are to be configured. The page permission generation module is used to generate page permission permission permitting identifiers when creating a page. This includes: generating page permission permission permitting identifiers based on the page's JSON data and attaching them to the root node of the JSON object; and obtaining the function keys for the permissions to be configured corresponding to the page. This includes: recursively traversing the page's JSON tree, determining whether the current level's JSON object contains function keys corresponding to a preset behavior type; if it contains function keys corresponding to the preset behavior type, obtaining the label of the function key; matching the label of the function key with the labels of function keys for the permissions to be configured in the function key dictionary; if a match is successful, the function key is determined to be a function key for the permissions to be configured; and obtaining all function keys for the permissions to be configured corresponding to the page after traversal. The function key permission generation module is used to query the attribute value of the function key corresponding to the permission to be configured on the page according to the function key dictionary, and concatenate the page permission permission permission identifier with the attribute value to obtain the permission permission permission identifier of the function key to be configured.
7. An electronic device, characterized in that, It includes a processor and a memory storing program instructions, the processor being configured to, when executing the program instructions, perform the automatic generation method of page permissions as described in any one of claims 1 to 5.
8. A computer-readable medium, characterized in that, It stores computer-readable instructions that are executed by a processor to implement an automatic generation method for page permissions as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Authority management method of service examination and approval system and apparatus thereof
CN106485388A
Permission management method and system
CN111988337A
Operation authority control method and device, equipment and storage medium
CN114048497A