[go: up one dir, main page]

CN118797747A - A fine-grained permission control method, device, equipment and storage medium - Google Patents

A fine-grained permission control method, device, equipment and storage medium Download PDF

Info

Publication number
CN118797747A
CN118797747A CN202411282075.3A CN202411282075A CN118797747A CN 118797747 A CN118797747 A CN 118797747A CN 202411282075 A CN202411282075 A CN 202411282075A CN 118797747 A CN118797747 A CN 118797747A
Authority
CN
China
Prior art keywords
permission
row
data
authority
column
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411282075.3A
Other languages
Chinese (zh)
Inventor
马振文
马浩杰
伍立群
吕晓刚
陈雨森
鲍奕刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202411282075.3A priority Critical patent/CN118797747A/en
Publication of CN118797747A publication Critical patent/CN118797747A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了一种细粒度的权限控制方法、装置、设备和存储介质,包括:根据数据访问权限对用户进行权限组分组;对数据表中的每个字段关联一个或多个权限组,使关联的权限组有该列的执行权限;对数据表中的每条数据记录关联一个或多个权限组,只有满足对应的行权限条件并关联的权限组有该行的执行权限;安全策略更新时,动态更新行权限和列权限;解析用户提出的数据请求,并根据数据访问权限验证用户是否具有对应数据的权限,若有则执行,反之则不执行。本发明通过列权限和行权限的设置,实现了对数据访问的细粒度控制,减少了数据泄露和未授权访问的风险,提高了安全性。

The present invention discloses a fine-grained permission control method, device, equipment and storage medium, including: grouping users into permission groups according to data access rights; associating one or more permission groups with each field in a data table, so that the associated permission group has the execution permission of the column; associating one or more permission groups with each data record in the data table, and only the permission group that meets the corresponding row permission conditions and is associated has the execution permission of the row; when the security policy is updated, the row permission and column permission are dynamically updated; parsing the data request raised by the user, and verifying whether the user has the permission for the corresponding data according to the data access rights, if yes, then execute, otherwise not execute. The present invention realizes fine-grained control of data access through the setting of column permissions and row permissions, reduces the risk of data leakage and unauthorized access, and improves security.

Description

一种细粒度的权限控制方法、装置、设备和存储介质A fine-grained permission control method, device, equipment and storage medium

技术领域Technical Field

本发明涉及计算机数据安全领域,尤其涉及一种细粒度的权限控制方法、装置、设备和存储介质。The present invention relates to the field of computer data security, and in particular to a fine-grained permission control method, device, equipment and storage medium.

背景技术Background Art

随着信息技术的快速发展和全球数据量的剧增,数据安全已成为企业和组织面临的一项重大挑战。数据安全关乎个人信息保护、企业知识产权以及关键商业操作的安全性。因此,确保敏感数据的安全成为了一个重要议题。然而,早期的数据安全解决方案主要侧重于防火墙和传统的安全机制,这些机制通常专注于防止外部攻击,而对于内部威胁和细粒度的数据访问控制则处理不足。此外,随着云计算和分布式系统的流行,数据越来越多地被存储在分布式环境中,这使得数据的管理和保护更加复杂。比如有以下关键问题:With the rapid development of information technology and the dramatic increase in global data volume, data security has become a major challenge facing enterprises and organizations. Data security is related to the protection of personal information, corporate intellectual property, and the security of key business operations. Therefore, ensuring the security of sensitive data has become an important issue. However, early data security solutions mainly focused on firewalls and traditional security mechanisms, which usually focused on preventing external attacks, but did not adequately address internal threats and fine-grained data access control. In addition, with the popularity of cloud computing and distributed systems, data is increasingly stored in distributed environments, which makes data management and protection more complicated. For example, there are the following key issues:

(1)细粒度访问控制:需要对数据访问进行更细致的控制,不仅仅是哪些用户可以访问系统,还包括他们可以访问和操作数据的具体方式。(1) Fine-grained access control: More detailed control is required over data access, not just which users can access the system, but also the specific ways in which they can access and manipulate data.

(2)动态权限管理:随着组织结构和业务需求的变化,权限管理系统需要能够灵活地调整和实时更新,以应对不断变化的访问需求。(2) Dynamic permission management: As organizational structure and business needs change, the permission management system needs to be able to flexibly adjust and update in real time to cope with changing access requirements.

(3)多环境兼容性:随着企业IT架构的多样化,数据安全解决方案需要能够在多种环境中有效工作,包括传统的数据中心、私有云和公有云。(3) Multi-environment compatibility: As enterprise IT architectures diversify, data security solutions need to be able to work effectively in multiple environments, including traditional data centers, private clouds, and public clouds.

综上所述,现有的数据安全解决方案存在对内部威胁的防护不足、缺乏灵活的动态权限管理能力以及在多种环境中应用的兼容性差等问题,这些缺陷限制了其在日益复杂的数据环境中的有效性,亟需提出更加完善和创新的解决方案。In summary, existing data security solutions have problems such as insufficient protection against internal threats, lack of flexible dynamic permission management capabilities, and poor compatibility in multiple environments. These defects limit their effectiveness in increasingly complex data environments, and more complete and innovative solutions are urgently needed.

发明内容Summary of the invention

针对现有技术的不足,本发明提出一种细粒度的权限控制方法、装置、设备和存储介质,解决了现有技术中细粒度访问控制,动态权限管理,多环境兼容等的问题。In view of the deficiencies in the prior art, the present invention proposes a fine-grained permission control method, device, equipment and storage medium, which solve the problems of fine-grained access control, dynamic permission management, multi-environment compatibility, etc. in the prior art.

具体技术方案如下:The specific technical solutions are as follows:

一种细粒度的权限控制方法,包括以下步骤:A fine-grained permission control method includes the following steps:

S1:对用户进行权限组分组,不同的权限组拥有不同的数据访问权限,所述数据访问权限包括列权限和行权限;S1: Grouping users into permission groups, where different permission groups have different data access permissions, including column permissions and row permissions;

S2、编辑数据表的列权限:对数据表中的每个字段,即每一列,分别关联一个或多个权限组,只有关联的权限组有该字段的执行权限;所述执行权限包括:读取、写入、更新、删除;当安全策略更新时,对列权限进行动态编辑;S2. Editing column permissions of a data table: Associate one or more permission groups with each field, i.e., each column, in a data table. Only the associated permission group has execution permissions for the field. The execution permissions include: read, write, update, and delete. When the security policy is updated, the column permissions are dynamically edited.

S3、编辑数据表的行权限:对数据表中的每条数据记录,即每一行,分别关联一个或多个权限组,只有满足对应的行权限条件并关联的权限组有该条数据记录的执行权限;所述行权限条件根据业务规则或数据敏感性生成;当安全策略更新时,动态更新行权限条件,并对行权限进行动态编辑;S3. Edit row permissions of a data table: associate one or more permission groups with each data record, i.e. each row, in the data table. Only the permission groups that meet the corresponding row permission conditions and are associated have the execution permission for the data record. The row permission conditions are generated according to business rules or data sensitivity. When the security policy is updated, the row permission conditions are dynamically updated, and the row permissions are dynamically edited.

S4:对用户发起的数据请求SQL语句进行解析,并根据设置的列权限和行权限验证用户是否具有对应数据的权限,若有,则执行数据请求;反之,则不执行。S4: Parse the data request SQL statement initiated by the user, and verify whether the user has the corresponding data permissions based on the set column permissions and row permissions. If yes, execute the data request; otherwise, do not execute.

进一步地,所述S2具体通过如下子步骤实现:Furthermore, S2 is specifically implemented through the following sub-steps:

S201:从数据库中选择需要配置列权限的数据表;S201: Select a data table for which column permissions need to be configured from a database;

S202:将选定的数据表的列权限关联到一个或多个权限组;S202: Associating the column permissions of the selected data table with one or more permission groups;

S203:选择数据表中需要配置列权限的具体字段;S203: Select the specific field in the data table for which column permissions need to be configured;

S204:对于每个选择的字段,设置一个或多个权限组对该字段的执行权限。S204: For each selected field, set execution permissions for the field for one or more permission groups.

进一步地,所述S202中,若现有权限组无法实现列权限关联要求,创建新的权限组,并将需要关联列权限的用户添加到新的权限组中,将选定的数据表的列权限与新的权限组关联。Furthermore, in S202, if the existing permission group cannot meet the column permission association requirement, a new permission group is created, and users who need to associate column permissions are added to the new permission group, and the column permissions of the selected data table are associated with the new permission group.

进一步地,所述S3具体通过如下子步骤实现:Furthermore, S3 is specifically implemented through the following sub-steps:

S301:从数据库中选择需要配置行权限的数据表;S301: Select a data table for which row permissions need to be configured from the database;

S302:将选定的数据表的行权限关联到一个或多个权限组;S302: Associating the row permissions of the selected data table with one or more permission groups;

S303、编辑行权限条件:为关联的权限组设置行权限条件,所述行权限条件为基于数据表中的特定字段值的条件表达式对应的SQL语句;S303, edit row permission conditions: set row permission conditions for the associated permission group, wherein the row permission conditions are SQL statements corresponding to conditional expressions based on specific field values in the data table;

S304、设置行执行权限:基于定义的行权限条件,设置权限组对数据表中各行的执行权限。S304, setting row execution permissions: based on the defined row permission conditions, setting the permission group's execution permissions for each row in the data table.

进一步地,所述S302中,若现有权限组无法实现行权限关联要求,创建新的权限组,并将需要关联行权限的用户添加到新的权限组中,将选定的数据表的行权限与新的权限组关联。Furthermore, in S302, if the existing permission group cannot meet the row permission association requirement, a new permission group is created, and users who need to be associated with row permissions are added to the new permission group, and the row permissions of the selected data table are associated with the new permission group.

进一步地,所述S303具体包括如下步骤:Furthermore, the S303 specifically includes the following steps:

S3031:根据需要选择数据库中需要设置行权限的字段;S3031: Select the field in the database for which row permissions need to be set as needed;

S3032:判断选择的字段所属的类型;数据库中的字段根据属性分为:数值类、字符串类、用户属性类;选择的字段根据其属性归入对应类型;S3032: Determine the type of the selected field. Fields in the database are classified into the following types according to their attributes: numerical type, string type, and user attribute type. The selected field is classified into the corresponding type according to its attributes.

S3033:根据字段所属的类型设置字段条件:S3033: Set field conditions based on the type of field:

若字段类型为数值类,设置该字段的取值范围;If the field type is numeric, set the value range of the field;

若字段类型为字符串类,为数据库中该字段的现有值的枚举值或新增自定义值,使该字段的值等于某一字符串,或属于某一个字符串集合,或不属于某一个字符串集合;If the field type is string, it is an enumeration value of the existing value of the field in the database or a new custom value is added, so that the value of the field is equal to a certain string, belongs to a certain string set, or does not belong to a certain string set;

若字段类型为用户属性类,设置该字段的值等于用户属性表中的相应属性的某一个值,或属于用户属性表中的相应属性中某些值的集合,或不属于用户属性表中的相应属性中某些值的集合;If the field type is user attribute class, set the value of the field to be equal to a certain value of the corresponding attribute in the user attribute table, or a set of certain values of the corresponding attribute in the user attribute table, or a set of certain values that do not belong to the corresponding attribute in the user attribute table;

S3034:根据设置的字段条件,生成对应SQL语义的SQL条件语句,得到行权限条件。S3034: Generate an SQL conditional statement corresponding to the SQL semantics according to the set field conditions to obtain the row permission conditions.

进一步地,管理员通过图形用户界面或命令行界面执行S2和S3。Furthermore, the administrator executes S2 and S3 through a graphical user interface or a command line interface.

一种细粒度的权限控制装置,用于实现所述的细粒度的权限控制方法,包括:权限配置模块、安全策略编辑模块、身份验证模块、SQL解析模块、访问控制模块、日志和审计模块、界面管理模块;A fine-grained permission control device, used to implement the fine-grained permission control method, comprising: a permission configuration module, a security policy editing module, an identity authentication module, an SQL parsing module, an access control module, a log and audit module, and an interface management module;

所述权限配置模块用于定义和管理用户及其所属权限组的数据访问权限,管理员通过该模块将用户分入不同权限组并分配不同的列权限和行权限;The permission configuration module is used to define and manage the data access rights of users and their permission groups. The administrator can use this module to divide users into different permission groups and assign different column permissions and row permissions.

所述安全策略编辑模块用于实时编辑和更新安全策略,管理员通过该模块创建和修改对数据表的行权限条件和列权限;The security policy editing module is used to edit and update security policies in real time. Administrators use this module to create and modify row permission conditions and column permissions for data tables.

所述身份验证模块用于验证发出数据请求的用户的身份和所拥有的数据访问权限;The identity verification module is used to verify the identity of the user who issues the data request and the data access rights he/she has;

所述SQL解析模块用于解析用户发起的数据请求SQL语句,并拼接行权限条件和列权限的SQL语句;The SQL parsing module is used to parse the data request SQL statement initiated by the user and splice the SQL statement of the row permission condition and the column permission;

所述访问控制模块用于检查用户发起的数据请求SQL语句与当前权限配置的兼容性,并根据用户的权限决定是否允许执行SQL操作;The access control module is used to check the compatibility of the data request SQL statement initiated by the user with the current permission configuration, and decide whether to allow the SQL operation to be executed according to the user's permission;

所述日志和审计模块用于记录用户提出的所有数据请求;The log and audit module is used to record all data requests made by users;

所述界面管理模块用于提供可视化界面,允许管理员通过该界面配置权限和安全策略,并监控系统状态。The interface management module is used to provide a visual interface, allowing administrators to configure permissions and security policies and monitor system status through the interface.

一种电子设备,包括存储器和一个或多个处理器,所述存储器中存储有可执行代码,所述一个或多个处理器执行所述可执行代码时,用于实现所述的细粒度的权限控制方法。An electronic device includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the fine-grained permission control method.

一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时,实现所述的细粒度的权限控制方法。A computer-readable storage medium stores a program, which, when executed by a processor, implements the fine-grained permission control method.

本发明的有益效果是:The beneficial effects of the present invention are:

(1)本发明通过列权限和行权限的设置,实现了对数据访问的细粒度控制,并通过精确的权限控制减少了数据泄露和未授权访问的风险,提高了安全性。(1) The present invention achieves fine-grained control over data access by setting column permissions and row permissions, and reduces the risk of data leakage and unauthorized access through precise permission control, thereby improving security.

(2)本发明能动态地调整列权限和行权限设置,以适应业务需求和安全策略的变化。(2) The present invention can dynamically adjust column permissions and row permissions to adapt to changes in business needs and security policies.

(3)本发明通过权限配置模块和安全策略编辑模块,集中进行列权限和行权限配置,以及安全策略的调整,使管理更为便捷。(3) The present invention uses a permission configuration module and a security policy editing module to centrally configure column permissions and row permissions, as well as adjust security policies, making management more convenient.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

图1是本发明实施例中提出的细粒度的权限控制方法的流程示意图。FIG1 is a schematic flow chart of a fine-grained permission control method proposed in an embodiment of the present invention.

图2是本发明实施例中提出的细粒度的权限控制方法的列权限编辑流程示意图。FIG. 2 is a schematic diagram of a column permission editing process of a fine-grained permission control method proposed in an embodiment of the present invention.

图3是本发明实施例中提出的细粒度的权限控制方法的行权限编辑流程示意图。FIG3 is a schematic diagram of a row permission editing process of a fine-grained permission control method proposed in an embodiment of the present invention.

图4是本发明实施例中提出的细粒度的权限控制方法的行权限条件编辑流程示意图。FIG. 4 is a schematic diagram of a row permission condition editing process of a fine-grained permission control method proposed in an embodiment of the present invention.

图5是本发明实施例中提出的电子设备的结构示意图。FIG. 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

在以下的描述中,涉及到“一个具体实施例”,其描述了所有可能实施例的子集,但是可以理解,“一个具体实施例”,其描述了所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “one specific embodiment”, which describes a subset of all possible embodiments, but it can be understood that “one specific embodiment” describes the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.

除非另有定义,本文所使用的所有的技术的科学技术与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。Unless otherwise defined, all technical science and technology used herein have the same meaning as commonly understood by those skilled in the art of the present invention. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

在对本发明实施例进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.

(1)SQL语言(结构化查询语言,Structured Query Language),是用于管理和查询数据库中的数据的标准计算机语言,其功能丰富且简洁,能够完成复杂的数据库操作,具有广泛的应用场景。(1) SQL (Structured Query Language) is a standard computer language used to manage and query data in databases. It is feature-rich and concise, capable of performing complex database operations, and has a wide range of application scenarios.

(2)图形用户界面(Graphical User Interface,以下简称GUI),是一种基于图形化界面的操作系统用户界面,通过图形元素(如窗口、图标、按钮和菜单)与用户进行交互。该界面允许用户使用鼠标等输入设备操纵屏幕上的图标或菜单选项,以选择命令、调用文件、启动程序或执行其他日常任务。(2) Graphical User Interface (GUI) is an operating system user interface based on a graphical interface that interacts with users through graphical elements (such as windows, icons, buttons, and menus). This interface allows users to use input devices such as a mouse to manipulate icons or menu options on the screen to select commands, call files, start programs, or perform other daily tasks.

(3)命令行界面(Command Line Interface,以下简称CLI),是一种通过键盘输入文本命令来与计算机进行交互的用户界面。用户可以在命令行或终端界面输入命令和参数来完成各种操作,如创建、删除、移动文件和目录、配置网络以及运行程序等。(3) Command Line Interface (CLI) is a user interface that interacts with a computer by entering text commands on the keyboard. Users can enter commands and parameters in the command line or terminal interface to complete various operations, such as creating, deleting, and moving files and directories, configuring networks, and running programs.

(4)字段:数据表中的垂直部分,定义了数据表中数据的类型,每个字段都有一个名称和一种数据类型(如整数、字符串、日期等),用于指定该字段可以存储的数据类型。字段代表了数据表中的一个属性或特征,比如在一个员工表中,字段包括:员工ID、姓名、年龄、职位等。(4) Field: A vertical part of a data table that defines the type of data in the table. Each field has a name and a data type (such as integer, string, date, etc.) that specifies the type of data that the field can store. A field represents an attribute or feature in a data table. For example, in an employee table, the fields include: employee ID, name, age, position, etc.

(5)数据记录:数据表中的水平部分,它包含了数据表中一行完整的数据,每一行数据记录都是表中所有字段的一个具体实例,即每个字段在该记录中都有一个具体的值。例如:在员工表中,一条数据记录包含了某个具体员工的员工ID、姓名、年龄、职位的具体值。(5) Data record: The horizontal part of a data table, which contains a complete row of data in the data table. Each row of data record is a specific instance of all the fields in the table, that is, each field has a specific value in the record. For example: in the employee table, a data record contains the specific values of the employee ID, name, age, and position of a specific employee.

需要说明的是,在不冲突的情况下,下述的实施例及实施方式中的特征可以相互组合。It should be noted that, in the absence of conflict, the features in the following embodiments and implementations may be combined with each other.

如图1所示,本发明实施例提供的一种细粒度的权限控制方法,具体包括以下步骤:As shown in FIG1 , a fine-grained permission control method provided by an embodiment of the present invention specifically includes the following steps:

S1、对用户进行权限组分组:创建不同的权限组,每个权限组定义一组特定的数据访问权限;将用户分入对应的权限组中。数据访问权限包括对特定列(即字段)和行(即数据记录)的访问权限进行个性化设置,即列权限和行权限。S1. Group users into permission groups: Create different permission groups, each of which defines a specific set of data access permissions; divide users into corresponding permission groups. Data access permissions include personalized settings for access permissions to specific columns (i.e. fields) and rows (i.e. data records), i.e. column permissions and row permissions.

该分组可进行动态调整,具体地,允许管理员根据业务需求或安全策略的变化,灵活地对用户进行分组,并为每个用户或权限组分配不同的数据访问权限。The grouping can be adjusted dynamically, specifically allowing administrators to flexibly group users according to changes in business needs or security policies, and assign different data access rights to each user or permission group.

S2:对数据表的列权限进行编辑。在此步骤中,管理员为一个或多个数据表中的各个字段(列)指定访问权限,使得只有被授权的用户或权限组才能访问或修改对应字段中的数据。这种权限设置可以通过图形用户界面(GUI)或命令行界面(CLI)进行编辑和更新,以适应组织内部权限管理的需求变化。S2: Edit the column permissions of the data table. In this step, the administrator specifies access permissions for each field (column) in one or more data tables so that only authorized users or permission groups can access or modify the data in the corresponding fields. This permission setting can be edited and updated through the graphical user interface (GUI) or command line interface (CLI) to adapt to changes in the organization's internal permission management needs.

如图2所示,本发明实施例中,S2具体通过如下子步骤实现:As shown in FIG. 2 , in the embodiment of the present invention, S2 is specifically implemented through the following sub-steps:

S201、选择数据表:管理员从数据库中选择需要配置列权限的数据表。该步骤通过GUI实现(整个S2都可以通过GUI实现),允许管理员浏览数据库结构并选择特定的表。S201, select data table: The administrator selects the data table from the database for which column permissions need to be configured. This step is implemented through the GUI (the entire S2 can be implemented through the GUI), allowing the administrator to browse the database structure and select a specific table.

S202、关联用户或权限组:在选定数据表后,管理员将选定的数据表的列权限关联到单个用户或权限组。管理员可以创建新的权限组,并将相关用户添加到这些权限组中,然后将选定的数据表与用户或权限组关联,以便进行后续的权限设置。S202, associate user or permission group: After selecting a data table, the administrator associates the column permissions of the selected data table to a single user or permission group. The administrator can create new permission groups and add relevant users to these permission groups, and then associate the selected data table with the user or permission group for subsequent permission settings.

S203、选择数据表字段:在选定的数据表关联用户或权限组后,通过界面提供的字段列表,管理员需要查看并选择数据表中需要配置列权限的具体字段。S203, select data table fields: After the selected data table is associated with a user or permission group, the administrator needs to view and select the specific fields in the data table for which column permissions need to be configured through the field list provided in the interface.

S204、设置字段执行权限:对于每个选定的字段,管理员设置用户或权限组对该字段能执行的具体的权限,如读取、写入、更新或删除等权限。管理员还可以定义更复杂的列权限规则,例如设置字段级别的加密。在设置列权限后,管理员可以使用测试账户来验证列权限设置是否正确,确保只有授权的用户能够执行相应的操作。S204. Set field execution permissions: For each selected field, the administrator sets the specific permissions that the user or permission group can perform on the field, such as read, write, update, or delete permissions. The administrator can also define more complex column permission rules, such as setting field-level encryption. After setting column permissions, the administrator can use a test account to verify whether the column permission settings are correct to ensure that only authorized users can perform the corresponding operations.

完成上述列权限编辑设置后,管理员保存配置,这些配置将被应用到实际的数据访问控制中。After completing the above column permission editing settings, the administrator saves the configuration, which will be applied to the actual data access control.

在实际应用过程中,还需要对列权限配置进行持续的监控和审计,具体地,持续监控所有数据访问请求,确保它们符合配置的列权限规则;所有访问尝试和操作都被记录在审计日志中,以便于后续的审查和分析。另外,还需要进行定期审查和更新,具体地,管理员应定期审查列权限配置,确保它们仍然符合组织的业务需求和安全策略;根据审查结果,管理员可以更新列权限设置,以应对新的安全威胁或业务变化。In actual application, the column permission configuration needs to be continuously monitored and audited. Specifically, all data access requests are continuously monitored to ensure that they comply with the configured column permission rules; all access attempts and operations are recorded in the audit log for subsequent review and analysis. In addition, regular review and updates are required. Specifically, administrators should regularly review column permission configurations to ensure that they still meet the organization's business needs and security policies; based on the review results, administrators can update column permission settings to respond to new security threats or business changes.

S3、对数据表行权限的定制化和动态编辑:除了列权限外,本方法还支持对每条数据记录的访问控制。管理员根据业务规则或数据敏感性,对数据表中的每条数据记录定义访问条件(即行权限条件),这些行权限条件由行权限编辑器生成并可以随时更新,以确保只有符合特定行权限条件的用户或权限组能够访问敏感数据或关键信息。S3. Customization and dynamic editing of data table row permissions: In addition to column permissions, this method also supports access control for each data record. Administrators define access conditions (i.e., row permission conditions) for each data record in the data table based on business rules or data sensitivity. These row permission conditions are generated by the row permission editor and can be updated at any time to ensure that only users or permission groups that meet specific row permission conditions can access sensitive data or key information.

如图3所示,本发明实施例中,行权限编辑具体通过如下子步骤实现:As shown in FIG. 3 , in the embodiment of the present invention, row permission editing is specifically implemented through the following sub-steps:

S301、选择数据表:管理员从数据库中选择需要配置行权限的数据表。该步骤通过GUI实现(整个S3都可以通过GUI实现),允许管理员浏览数据库结构并选择特定的表。S301, select data table: The administrator selects the data table for which row permissions need to be configured from the database. This step is implemented through the GUI (the entire S3 can be implemented through the GUI), allowing the administrator to browse the database structure and select a specific table.

S302、关联用户或权限组:在选定数据表后,管理员选择将选定的数据表的行权限关联到单个用户或权限组。管理员可以创建新的权限组,并将相关用户添加到这些权限组中,然后将选定的数据表与用户或权限组关联,以便进行后续的权限设置。S302, associate user or permission group: After selecting a data table, the administrator chooses to associate the row permissions of the selected data table with a single user or permission group. The administrator can create new permission groups and add relevant users to these permission groups, and then associate the selected data table with the user or permission group for subsequent permission settings.

S303、编辑行权限条件:管理员为关联的用户或权限组设置行级别的权限条件,这些行级别的权限条件基于数据表中的特定字段值,如用户ID、日期、金额等。管理员定义条件表达式,例如“用户ID等于当前登录用户ID”或“日期在特定范围内”,并测试定义的行级别的权限条件,确保它们按预期工作,只允许用户访问符合行级别的权限条件的数据行。行权限编辑器根据管理员设置的行级别的权限条件自动生成对应的SQL语句,得到行权限条件。S303. Edit row permission conditions: The administrator sets row-level permission conditions for the associated user or permission group. These row-level permission conditions are based on specific field values in the data table, such as user ID, date, amount, etc. The administrator defines conditional expressions, such as "user ID equals the current logged-in user ID" or "date is within a specific range", and tests the defined row-level permission conditions to ensure that they work as expected and only allow users to access data rows that meet the row-level permission conditions. The row permission editor automatically generates the corresponding SQL statement based on the row-level permission conditions set by the administrator to obtain the row permission conditions.

如图4所示,本发明实施例中,S303具体包括如下步骤:As shown in FIG. 4 , in the embodiment of the present invention, S303 specifically includes the following steps:

S3031、选择字段:管理员根据需要,选择数据库中需要设置行权限的字段。S3031. Select fields: The administrator selects the fields in the database for which row permissions need to be set as needed.

S3032、判断字段类型:根据数据库中字段属性的不同,分成简单操作的3种类型:数值类、字符串类、用户属性类。系统预先判断该字段属于哪种类型,同时管理员可以根据需要选择字段属于哪一类型。S3032. Determine the field type: According to the different field attributes in the database, it is divided into three types of simple operations: numerical type, string type, and user attribute type. The system pre-determines which type the field belongs to, and the administrator can select which type the field belongs to as needed.

S3033、根据字段类型设置字段条件:S3033. Set field conditions according to field type:

如果字段类型是数值类,比如integer类型,可以设置该字段的取值范围,一般的有等于、大于、小于、大于等于、小于等于,或区间组合。If the field type is a numeric type, such as integer type, you can set the value range of the field, which generally includes equal to, greater than, less than, greater than or equal to, less than or equal to, or an interval combination.

如果字段类型是字符串类,比如varchar类型,可以设置该字段的值为数据库中该字段的现有值的枚举值或新增自定义值,使该字段的值等于其中某一字符串,或属于其中某一个字符串集合,或不属于其中某一个字符串集合。If the field type is a string class, such as varchar type, you can set the value of the field to an enumeration value of the existing value of the field in the database or add a custom value, so that the value of the field is equal to one of the strings, belongs to one of the string sets, or does not belong to one of the string sets.

如果字段类型是用户属性类,比如部门等,可以设置该字段的值等于用户属性表中的相应属性的某一个值,或属于用户属性表中的相应属性中某些值的集合,或不属于用户属性表中的相应属性中某些值的集合。If the field type is a user attribute class, such as department, you can set the value of the field to be equal to a value of the corresponding attribute in the user attribute table, or to a set of certain values in the corresponding attribute in the user attribute table, or to a set of certain values that do not belong to the corresponding attribute in the user attribute table.

S3034:根据设置的字段条件,生成对应SQL语义的SQL条件语句。这些SQL条件语句可以在用户提出数据请求过程中用于对原始SQL语句进行约束。S3034: Generate SQL conditional statements corresponding to SQL semantics according to the set field conditions. These SQL conditional statements can be used to constrain original SQL statements in the process of users making data requests.

具体的,如薪资表有工号、姓名、薪水等字段,管理员设置了权限组1和权限组2,权限组1的在薪资表中的列条件为:可访问工号、姓名字段。行条件为:全部可访问。权限组2在薪资表中的列条件为:可访问工号、姓名、薪水字段。行条件为:可访问工号为信息部的行数据(工号为用户属性,可限制行权限条件为该工号的用户在用户属性表中的部门字段的值为信息部)。用户使用时,权限组1的用户不能访问薪水字段,但可以看到全部员工。权限组2的用户可以访问薪水字段,但仅可以看到信息部员工的薪水数据。Specifically, if the salary table has fields such as employee number, name, and salary, the administrator has set up permission group 1 and permission group 2. The column condition of permission group 1 in the salary table is: the employee number and name fields can be accessed. The row condition is: all can be accessed. The column condition of permission group 2 in the salary table is: the employee number, name, and salary fields can be accessed. The row condition is: the row data whose employee number is the Information Department can be accessed (the employee number is a user attribute, and the row permission condition can be limited to the user whose department field value in the user attribute table is the Information Department). When the user uses it, the user of permission group 1 cannot access the salary field, but can see all employees. The user of permission group 2 can access the salary field, but can only see the salary data of the employees in the Information Department.

S304、设置行执行权限:基于定义的行权限条件,管理员设置用户或权限组对数据表中各行能执行的具体权限,如读取、写入、更新或删除等权限。在设置权限后,管理员可以使用测试账户来验证行权限设置是否正确,确保只有授权的用户能够执行相应的操作。S304, set row execution permissions: Based on the defined row permission conditions, the administrator sets the specific permissions that users or permission groups can execute on each row in the data table, such as read, write, update or delete permissions. After setting permissions, the administrator can use a test account to verify whether the row permission settings are correct to ensure that only authorized users can perform corresponding operations.

完成上述行权限编辑设置后,管理员保存配置,这些配置将被应用到实际的数据访问控制中,确保只有符合条件的行数据对用户可见或可操作。After completing the above row permission editing settings, the administrator saves the configuration, which will be applied to the actual data access control to ensure that only qualified row data is visible or operable to users.

在实际应用过程中,还需要对行权限配置进行持续的监控和审计,具体地,持续监控所有数据访问请求,确保它们符合配置的行权限条件;所有访问尝试和操作都被记录在审计日志中,以便于后续的审查和分析。另外,还需要进行定期审查和更新,具体地,管理员应定期审查行权限配置,确保它们仍然符合组织的安全策略和业务需求;根据审查结果,管理员可以更新行权限设置,以应对新的安全威胁或业务变化。In actual application, row permission configurations need to be continuously monitored and audited. Specifically, all data access requests are continuously monitored to ensure that they meet the configured row permission conditions; all access attempts and operations are recorded in the audit log for subsequent review and analysis. In addition, regular review and updates are required. Specifically, administrators should regularly review row permission configurations to ensure that they still meet the organization's security policies and business needs; based on the review results, administrators can update row permission settings to respond to new security threats or business changes.

S4:对用户提出的数据请求进行权限检查和解析:当用户提交数据请求(如查询、更新或删除操作)时,解析该数据请求中的SQL语句。基于S2定义的列权限和S3定义的行权限设置,判断该请求是否被授予数据访问权限,若是,则执行该SQL语句;反之,则不执行该SQL语句。这个过程包括对请求者(即用户)的身份和权限的验证,从而确保只有拥有足够权限的用户才能访问或修改数据。S4: Check and parse the permissions of the data request made by the user: When the user submits a data request (such as a query, update, or delete operation), parse the SQL statement in the data request. Based on the column permissions defined in S2 and the row permissions defined in S3, determine whether the request is granted data access rights. If so, execute the SQL statement; otherwise, do not execute the SQL statement. This process includes verification of the identity and permissions of the requester (i.e., user), thereby ensuring that only users with sufficient permissions can access or modify data.

动态权限管理与策略更新:该细粒度的权限控制方法支持实时的权限变更和安全策略更新(即产生批量的权限变更),无需重启数据库或应用程序。这为管理者提供了极高的灵活性,以适应组织架构变动、角色变更或安全策略调整。Dynamic permission management and policy updates: This fine-grained permission control method supports real-time permission changes and security policy updates (i.e., batch permission changes) without restarting the database or application. This provides managers with great flexibility to adapt to organizational changes, role changes, or security policy adjustments.

在此基础上,为了实现上述细粒度的权限控制方法,本实施例还提供了一种细粒度的权限控制装置,包括:权限配置模块、安全策略编辑模块、身份验证模块、SQL解析模块、访问控制模块、日志和审计模块、界面管理模块。管理员通过界面管理模块显示的界面进行权限配置操作,这一权限配置操作基于权限配置模块和安全策略编辑模块进行。用户提出数据请求后,SQL解析模块对其进行解析和转换,身份验证模块验证用户所拥有的权限,访问控制模块根据用户所拥有的权限决定是否执行SQL操作。所有用户提出数据请求的记录和执行的记录,均通过日志和审计模块记录。On this basis, in order to implement the above-mentioned fine-grained permission control method, this embodiment also provides a fine-grained permission control device, including: a permission configuration module, a security policy editing module, an identity authentication module, an SQL parsing module, an access control module, a log and audit module, and an interface management module. The administrator performs permission configuration operations through the interface displayed by the interface management module, and this permission configuration operation is based on the permission configuration module and the security policy editing module. After the user makes a data request, the SQL parsing module parses and converts it, the identity authentication module verifies the user's permissions, and the access control module decides whether to execute the SQL operation based on the user's permissions. All records of data requests made by users and execution records are recorded through the log and audit modules.

具体地,权限配置模块用于定义和管理用户及其所属权限组的数据访问权限,管理员通过该模块对用户进行分组并分配不同的列权限和行权限。Specifically, the permission configuration module is used to define and manage data access permissions of users and their permission groups. Administrators use this module to group users and assign different column permissions and row permissions.

安全策略编辑模块用于实时编辑和更新安全策略,管理员通过这个模块创建和修改对数据表的行权限条件和列权限。The security policy editing module is used to edit and update security policies in real time. Administrators use this module to create and modify row permission conditions and column permissions for data tables.

身份验证模块用于验证发出数据请求的用户的身份和权限。The authentication module is used to verify the identity and authority of the user making the data request.

SQL解析模块用于解析用户发起的数据请求SQL语句,并拼接行权限条件和列权限的SQL语句。并检查该SQL请求与当前权限配置的兼容性,确保所有的数据库操作都符合安全策略。The SQL parsing module is used to parse the SQL statements of data requests initiated by users and to splice the SQL statements of row permission conditions and column permissions. It also checks the compatibility of the SQL request with the current permission configuration to ensure that all database operations comply with security policies.

访问控制模块用于检查用户发起的数据请求SQL语句与当前权限配置的兼容性,并执行基于权限配置的访问控制决策,即根据用户的权限决定是否允许执行SQL操作。The access control module is used to check the compatibility of the data request SQL statement initiated by the user with the current permission configuration, and to perform access control decisions based on the permission configuration, that is, to decide whether to allow the SQL operation to be executed based on the user's permissions.

日志和审计模块用于记录所有用户提出的数据请求(包括访问和操作尝试),以便后续进行监控和安全审计。The log and audit module is used to record all data requests made by users (including access and operation attempts) for subsequent monitoring and security auditing.

界面管理模块用于提供一个用户友好的界面,允许管理员方便地通过该界面配置权限和安全策略,并监控系统状态。The interface management module is used to provide a user-friendly interface, allowing administrators to easily configure permissions and security policies and monitor system status through the interface.

本发明还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被处理器执行时,实现上述细粒度的权限控制方法。The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned fine-grained permission control method is implemented.

本发明还提供了如图5所示的一种电子设备,在硬件层面,该一种编辑权限、控制权限的电子设备包括:处理器、内部总线、网络接口、内存以及非易失性存储器,当然还可能包括其他业务所需要的硬件。处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,以实现上述细粒度的权限控制方法。当然,除了软件实现方式之外,本发明并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。The present invention also provides an electronic device as shown in FIG5. At the hardware level, the electronic device for editing permissions and controlling permissions includes: a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned fine-grained permission control method. Of course, in addition to the software implementation method, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本发明时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and/or hardware.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储介质中,使得存储在该计算机可读存储介质中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable storage medium produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

本领域技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本发明可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本发明,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

本发明中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

以上所述仅为本发明的实施例而已,并不用于限制本发明。对于本领域技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本发明的权利要求范围之内。The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A fine-grained authority control method, characterized by comprising the steps of:
S1: performing authority group grouping on users, wherein different authority groups have different data access authorities, and the data access authorities comprise column authorities and row authorities;
S2, editing column authorities of a data table: for each field in the data table, namely each column, one or more permission groups are respectively associated, and only the associated permission group has the execution permission of the field; the execution authority comprises the following steps: reading, writing, updating and deleting; when the security policy is updated, dynamically editing the column rights;
S3, editing row permission of the data table: for each data record in the data table, namely each row, one or more permission groups are respectively associated, and only the permission groups which meet the permission conditions of the corresponding row and are associated have the execution permission of the data record; the line authority conditions are generated according to business rules or data sensitivity; when the security policy is updated, dynamically updating the row authority conditions and dynamically editing the row authority;
s4: analyzing the SQL statement of the data request initiated by the user, verifying whether the user has the authority of the corresponding data according to the set column authority and row authority, and executing the data request if the user has the authority of the corresponding data; otherwise, the method is not executed.
2. The fine-grained entitlement control method according to claim 1, characterized in that S2 is realized in particular by the sub-steps of:
S201: selecting a data table needing configuration column permission from a database;
s202: associating column permissions of the selected data table to one or more permission groups;
s203: selecting a specific field needing to be configured with column permission in a data table;
s204: for each selected field, one or more permission groups are set to execute permissions on that field.
3. The fine-grained permission control method according to claim 2, wherein in S202, if the existing permission group cannot fulfill the column permission association requirement, a new permission group is created, and the user who needs to associate the column permission is added to the new permission group, and the column permission of the selected data table is associated with the new permission group.
4. The fine-grained entitlement control method according to claim 1, characterized in that S3 is realized in particular by the sub-steps of:
S301: selecting a data table needing to be configured with row authorities from a database;
S302: associating row permissions of the selected data table to one or more permission groups;
S303, editing line authority conditions: setting row authority conditions for the associated authority groups, wherein the row authority conditions are SQL sentences corresponding to conditional expressions based on specific field values in a data table;
S304, setting row execution permission: and setting the execution authority of the authority group on each row in the data table based on the defined row authority condition.
5. The fine-grained permission control method according to claim 4, wherein in S302, if the existing permission set cannot fulfill the permission association requirement, a new permission set is created, and the users who need to associate the permission are added to the new permission set, and the permission of the selected data table is associated with the new permission set.
6. The fine-grained entitlement control method according to claim 4, wherein said S303 specifically comprises the steps of:
s3031: selecting a field in the database, which needs to be provided with row permission, according to the need;
s3032: judging the type of the selected field; fields in the database are classified into according to attributes: a numeric class, a character string class, and a user attribute class; the selected fields are classified into corresponding types according to the attribute of the selected fields;
s3033: setting field conditions according to the type to which the field belongs:
If the field type is a numerical value type, setting a value range of the field;
If the field type is a character string type, an enumeration value or a newly added custom value of the existing value of the field in the database is used for enabling the value of the field to be equal to a certain character string, or belong to a certain character string set, or not belong to a certain character string set;
If the field type is a user attribute type, setting the value of the field to be equal to a certain value of a corresponding attribute in the user attribute table, or belonging to a set of certain values in the corresponding attribute in the user attribute table, or not belonging to a set of certain values in the corresponding attribute in the user attribute table;
S3034: and generating SQL conditional statements corresponding to SQL semantics according to the set field conditions to obtain row permission conditions.
7. The fine-grained entitlement control method according to claim 1, wherein the administrator performs S2 and S3 through a graphical user interface or a command line interface.
8. A fine-grained authority control device for implementing the fine-grained authority control method according to any one of claims 1 to 7, characterized by comprising: the system comprises an authority configuration module, a security policy editing module, an identity verification module, an SQL analysis module, an access control module, a log and audit module and an interface management module;
The permission configuration module is used for defining and managing the data access permissions of the users and the permission groups to which the users belong, and an administrator divides the users into different permission groups and allocates different column permissions and row permissions through the module;
The security policy editing module is used for editing and updating the security policy in real time, and an administrator creates and modifies row permission conditions and column permissions of the data table through the module;
The identity verification module is used for verifying the identity of a user sending a data request and the owned data access authority;
the SQL analysis module is used for analyzing the SQL statement of the data request initiated by the user and splicing the SQL statement of the row authority condition and the column authority;
The access control module is used for checking the compatibility of a data request SQL statement initiated by a user and the current authority configuration, and determining whether to allow SQL operation to be executed or not according to the authority of the user;
the log and audit module is used for recording all data requests proposed by a user;
the interface management module is used for providing a visual interface, allowing an administrator to configure authority and security policies through the interface and monitoring the system state.
9. An electronic device comprising a memory and one or more processors, the memory having executable code stored therein, the one or more processors configured to implement the fine-grained entitlement control method of any of claims 1-7 when executing the executable code.
10. A computer-readable storage medium, having stored thereon a program which, when executed by a processor, implements the fine-grained entitlement control method of any of claims 1-7.
CN202411282075.3A 2024-09-13 2024-09-13 A fine-grained permission control method, device, equipment and storage medium Pending CN118797747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411282075.3A CN118797747A (en) 2024-09-13 2024-09-13 A fine-grained permission control method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411282075.3A CN118797747A (en) 2024-09-13 2024-09-13 A fine-grained permission control method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118797747A true CN118797747A (en) 2024-10-18

Family

ID=93025662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411282075.3A Pending CN118797747A (en) 2024-09-13 2024-09-13 A fine-grained permission control method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118797747A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114021186A (en) * 2021-11-01 2022-02-08 航天科工网络信息发展有限公司 A fine-grained access control method for WEB system ranks based on runtime HOOK
CN114840521A (en) * 2022-04-22 2022-08-02 北京友友天宇系统技术有限公司 Database authority management and data protection method, device, equipment and storage medium
CN117540394A (en) * 2023-10-12 2024-02-09 璞华科技有限公司 Data authority configuration management method, data query method and system
CN118568125A (en) * 2024-08-01 2024-08-30 辽宁中科集成技术有限公司 Management method and system of security database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114021186A (en) * 2021-11-01 2022-02-08 航天科工网络信息发展有限公司 A fine-grained access control method for WEB system ranks based on runtime HOOK
CN114840521A (en) * 2022-04-22 2022-08-02 北京友友天宇系统技术有限公司 Database authority management and data protection method, device, equipment and storage medium
CN117540394A (en) * 2023-10-12 2024-02-09 璞华科技有限公司 Data authority configuration management method, data query method and system
CN118568125A (en) * 2024-08-01 2024-08-30 辽宁中科集成技术有限公司 Management method and system of security database

Similar Documents

Publication Publication Date Title
US10979438B2 (en) Policy management, enforcement, and audit for data security
CN113692582B (en) User interface for establishing a data privacy pipeline and contract agreement to share data
US8949209B2 (en) Method and system for anonymizing data during export
US20130212703A1 (en) Role-Based Content Rendering
US20090313079A1 (en) Managing access rights using projects
US20140090026A1 (en) System and Method for Managing Role Based Access Controls of Users
US11971909B2 (en) Data processing system with manipulation of logical dataset groups
US10936740B2 (en) Systems and methods for securing an entity-relationship system
KR20060071861A (en) Viewing Security in the CRM Database
US20250106221A1 (en) Fine granularity control of data access and usage across multi-tenant systems
US8214382B1 (en) Database predicate constraints on structured query language statements
EP2570943B1 (en) Protection of data privacy in an enterprise system
CN116702213A (en) Service system data authority management method, device and equipment for multi-level enterprise
US6751509B2 (en) Method for access control of aggregated data
CN113255000A (en) Data access control method and device, electronic equipment and readable storage medium
CN118797747A (en) A fine-grained permission control method, device, equipment and storage medium
WO2010091607A1 (en) Method for providing custom access control mode in file system
US12242637B2 (en) Augmented intelligent machine for systematic attribution of data security
CN118656874B (en) Method and system for realizing row-column access control of database
CN118916906B (en) Data permission configuration method, device and storage medium
US12380062B1 (en) Data set management using data set lineage metadata
CN115859348A (en) Method, system and equipment for controlling data authority in database management software
Yuan et al. Designing Data Permissions in the Enterprise Application Environment
CN119272264A (en) User authority control method, device, computer equipment and readable storage medium
CN120447907A (en) Development system and method for quickly forming management capability of special equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20241018