-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprivileges.go
42 lines (37 loc) · 1.12 KB
/
privileges.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package acl
// Privileges represents a PostgreSQL ACL bitmask
type Privileges uint16
// See postgresql/src/include/utils/acl.h for inspiration. Like PostgreSQL,
// "rights" refer to the combined grant option and privilege bits fields.
const (
NoPrivs Privileges = 0
// Ordering taken from postgresql/src/include/nodes/parsenodes.h
Insert Privileges = 1 << iota
Select
Update
Delete
Truncate
References
Trigger
Execute
Usage
Create
Temporary
Connect
numPrivileges
)
const (
validColumnPrivs = Insert | Select | Update | References
validDatabasePrivs = Create | Temporary | Connect
validDomainPrivs = Usage
validForeignDataWrapperPrivs = Usage
validForeignServerPrivs = Usage
validFunctionPrivs = Execute
validLanguagePrivs = Usage
validLargeObjectPrivs = Select | Update
validSchemaPrivs = Usage | Create
validSequencePrivs = Usage | Select | Update
validTablePrivs = Insert | Select | Update | Delete | Truncate | References | Trigger
validTablespacePrivs = Create
validTypePrivs = Usage
)