代码改变世界

PostgreSQL的Access control lists

  abce  阅读(197)  评论(0编辑  收藏  举报

ACL表现行式:

1
grantee=flags/grantor

其中:

·grantee:被授予权限的角色

·flags:字符串方式表示的权限

·grantor:授权的用户

 

 

FlagDescriptionStatementsApplies to
a append, insert new data INSERT tables, columns
r read, get data SELECT tables, columns, and sequences
w write, update data UPDATE tables
d delete data DELETE tables
D delete all data TRUNCATE tables
C create a new object CREATE databases, schemas, and table spaces
c connect to a database   database
t trigger, react to data changes CREATE TRIGGER tables
T crate temporary objects CREATE TEMP tables
x cross reference between data FOREIGN KEY tables
X execute runnable code CALL, SELECT functions, routines, and procedures
U use of various objects   sequences, schemas, foreign objects, types, and languages

 例如,查看表abc_project上的ACLs

1
2
3
4
5
6
7
8
#\dp abc_project
                                     Access privileges
 Schema |    Name     | Type  |      Access privileges      | Column privileges | Policies
--------+-------------+-------+-----------------------------+-------------------+----------
 public | abc_project | table | abc_adada=arwdDxt/abc_adada+|                   |
        |             |       | hahauuu=rw/abc_adada       +|                   |
        |             |       | xixixiao=r/abc_adada       +|                   | 
(1 row)

  

默认的ACLs

新创建的对象,如果没有做任何授权,acl内容为空,就需要使用默认的ACLs了:

1
2
3
4
5
6
7
8
#create table abce(id int);
CREATE TABLE
postgres@[local]:5631=#\dp abce;
                            Access privileges
 Schema | Name | Type  | Access privileges | Column privileges | Policies
--------+------+-------+-------------------+-------------------+----------
 public | abce | table |                   |                   |
(1 row)

  

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2016-01-22 SQL Performance Analyzer
点击右上角即可分享
微信分享提示