-
Notifications
You must be signed in to change notification settings - Fork 422
/
privileges.go
292 lines (241 loc) · 15.5 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
package sdk
type GlobalPrivilege string
const (
GlobalPrivilegeCreateAccount GlobalPrivilege = "CREATE ACCOUNT"
GlobalPrivilegeCreateApplication GlobalPrivilege = "CREATE APPLICATION"
GlobalPrivilegeCreateApplicationPackage GlobalPrivilege = "CREATE APPLICATION PACKAGE"
GlobalPrivilegeCreateComputePool GlobalPrivilege = "CREATE COMPUTE POOL"
GlobalPrivilegeCreateDataExchangeListing GlobalPrivilege = "CREATE DATA EXCHANGE LISTING"
GlobalPrivilegeCreateDatabase GlobalPrivilege = "CREATE DATABASE"
GlobalPrivilegeCreateFailoverGroup GlobalPrivilege = "CREATE FAILOVER GROUP"
GlobalPrivilegeCreateIntegration GlobalPrivilege = "CREATE INTEGRATION"
GlobalPrivilegeCreateNetworkPolicy GlobalPrivilege = "CREATE NETWORK POLICY"
GlobalPrivilegeCreateExternalVolume GlobalPrivilege = "CREATE EXTERNAL VOLUME"
GlobalPrivilegeCreateReplicationGroup GlobalPrivilege = "CREATE REPLICATION GROUP"
GlobalPrivilegeCreateRole GlobalPrivilege = "CREATE ROLE"
GlobalPrivilegeCreateShare GlobalPrivilege = "CREATE SHARE"
GlobalPrivilegeCreateUser GlobalPrivilege = "CREATE USER"
GlobalPrivilegeCreateWarehouse GlobalPrivilege = "CREATE WAREHOUSE"
GlobalPrivilegeAttachPolicy GlobalPrivilege = "ATTACH POLICY"
GlobalPrivilegeAudit GlobalPrivilege = "AUDIT"
GlobalPrivilegeBindServiceEndpoint GlobalPrivilege = "BIND SERVICE ENDPOINT"
GlobalPrivilegeApplyAggregationPolicy GlobalPrivilege = "APPLY AGGREGATION POLICY"
GlobalPrivilegeApplyAuthenticationPolicy GlobalPrivilege = "APPLY AUTHENTICATION POLICY"
GlobalPrivilegeApplyMaskingPolicy GlobalPrivilege = "APPLY MASKING POLICY"
GlobalPrivilegeApplyPackagesPolicy GlobalPrivilege = "APPLY PACKAGES POLICY"
GlobalPrivilegeApplyPasswordPolicy GlobalPrivilege = "APPLY PASSWORD POLICY"
GlobalPrivilegeApplyProjectionPolicy GlobalPrivilege = "APPLY PROJECTION POLICY"
GlobalPrivilegeApplyRowAccessPolicy GlobalPrivilege = "APPLY ROW ACCESS POLICY"
GlobalPrivilegeApplySessionPolicy GlobalPrivilege = "APPLY SESSION POLICY"
GlobalPrivilegeApplyTag GlobalPrivilege = "APPLY TAG"
GlobalPrivilegeExecuteAlert GlobalPrivilege = "EXECUTE ALERT"
GlobalPrivilegeExecuteDataMetricFunction GlobalPrivilege = "EXECUTE DATA METRIC FUNCTION"
GlobalPrivilegeExecuteDataManagedAlert GlobalPrivilege = "EXECUTE MANAGED ALERT"
GlobalPrivilegeExecuteDataManagedTask GlobalPrivilege = "EXECUTE MANAGED TASK"
GlobalPrivilegeExecuteTask GlobalPrivilege = "EXECUTE TASK"
GlobalPrivilegeImportShare GlobalPrivilege = "IMPORT SHARE"
GlobalPrivilegeManageAccountSupportCases GlobalPrivilege = "MANAGE ACCOUNT SUPPORT CASES"
GlobalPrivilegeManageEventSharing GlobalPrivilege = "MANAGE EVENT SHARING"
GlobalPrivilegeManageGrants GlobalPrivilege = "MANAGE GRANTS"
GlobalPrivilegeManageListingAutoFulfillment GlobalPrivilege = "MANAGE LISTING AUTO FULFILLMENT"
GlobalPrivilegeManageOrganizationSupportCases GlobalPrivilege = "MANAGE ORGANIZATION SUPPORT CASES"
GlobalPrivilegeManageUserSupportCases GlobalPrivilege = "MANAGE USER SUPPORT CASES"
GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES"
GlobalPrivilegeModifyLogLevel GlobalPrivilege = "MODIFY LOG LEVEL"
GlobalPrivilegeModifyTraceLevel GlobalPrivilege = "MODIFY TRACE LEVEL"
GlobalPrivilegeModifySessionLogLevel GlobalPrivilege = "MODIFY SESSION LOG LEVEL"
GlobalPrivilegeModifySessionTraceLevel GlobalPrivilege = "MODIFY SESSION TRACE LEVEL"
GlobalPrivilegeMonitorExecution GlobalPrivilege = "MONITOR EXECUTION"
GlobalPrivilegeMonitorSecurity GlobalPrivilege = "MONITOR SECURITY"
GlobalPrivilegeMonitorUsage GlobalPrivilege = "MONITOR USAGE"
GlobalPrivilegeOverrideShareRestrictions GlobalPrivilege = "OVERRIDE SHARE RESTRICTIONS"
GlobalPrivilegePurchaseDataExchangeListing GlobalPrivilege = "PURCHASE DATA EXCHANGE LISTING"
GlobalPrivilegeResolveAll GlobalPrivilege = "RESOLVE ALL"
)
func (p GlobalPrivilege) String() string {
return string(p)
}
type AccountObjectPrivilege string
const (
// For COMPUTE POOL
// AccountObjectPrivilegeOperate AccountObjectPrivilege = "OPERATE" (duplicate)
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
// For DATABASE
AccountObjectPrivilegeApplyBudget AccountObjectPrivilege = "APPLYBUDGET"
AccountObjectPrivilegeCreateDatabaseRole AccountObjectPrivilege = "CREATE DATABASE ROLE"
AccountObjectPrivilegeCreateSchema AccountObjectPrivilege = "CREATE SCHEMA"
AccountObjectPrivilegeImportedPrivileges AccountObjectPrivilege = "IMPORTED PRIVILEGES"
AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY"
AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR"
AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE"
// For EXTERNAL VOLUME
// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
// For FAILOVER GROUP
AccountObjectPrivilegeFailover AccountObjectPrivilege = "FAILOVER"
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
// AccountObjectPrivilegeReplicate AccountObjectPrivilege = "REPLICATE" (duplicate)
// For INTEGRATION
// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
AccountObjectPrivilegeUseAnyRole AccountObjectPrivilege = "USE_ANY_ROLE"
// For REPLICATION GROUP
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
AccountObjectPrivilegeReplicate AccountObjectPrivilege = "REPLICATE"
// For RESOURCE MONITOR
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
// For USER
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// For WAREHOUSE
// AccountObjectPrivilegeApplyBudget AccountObjectPrivilege = "APPLYBUDGET" (duplicate)
// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
AccountObjectPrivilegeOperate AccountObjectPrivilege = "OPERATE"
)
func (p AccountObjectPrivilege) String() string {
return string(p)
}
type SchemaPrivilege string
const (
SchemaPrivilegeAddSearchOptimization SchemaPrivilege = "ADD SEARCH OPTIMIZATION"
SchemaPrivilegeApplyBudget SchemaPrivilege = "APPLYBUDGET"
SchemaPrivilegeCreateAlert SchemaPrivilege = "CREATE ALERT"
SchemaPrivilegeCreateCortexSearchService SchemaPrivilege = "CREATE CORTEX SEARCH SERVICE"
SchemaPrivilegeCreateDataset SchemaPrivilege = "CREATE DATASET"
SchemaPrivilegeCreateEventTable SchemaPrivilege = "CREATE EVENT TABLE"
SchemaPrivilegeCreateFileFormat SchemaPrivilege = "CREATE FILE FORMAT"
SchemaPrivilegeCreateFunction SchemaPrivilege = "CREATE FUNCTION"
SchemaPrivilegeCreateGitRepository SchemaPrivilege = "CREATE GIT REPOSITORY"
SchemaPrivilegeCreateImageRepository SchemaPrivilege = "CREATE IMAGE REPOSITORY"
SchemaPrivilegeCreateModel SchemaPrivilege = "CREATE MODEL"
SchemaPrivilegeCreateNetworkRule SchemaPrivilege = "CREATE NETWORK RULE"
SchemaPrivilegeCreateNotebook SchemaPrivilege = "CREATE NOTEBOOK"
SchemaPrivilegeCreatePipe SchemaPrivilege = "CREATE PIPE"
SchemaPrivilegeCreateProcedure SchemaPrivilege = "CREATE PROCEDURE"
SchemaPrivilegeCreateAggregationPolicy SchemaPrivilege = "CREATE AGGREGATION POLICY"
SchemaPrivilegeCreateAuthenticationPolicy SchemaPrivilege = "CREATE AUTHENTICATION POLICY"
SchemaPrivilegeCreateMaskingPolicy SchemaPrivilege = "CREATE MASKING POLICY"
SchemaPrivilegeCreatePackagesPolicy SchemaPrivilege = "CREATE PACKAGES POLICY"
SchemaPrivilegeCreatePasswordPolicy SchemaPrivilege = "CREATE PASSWORD POLICY"
SchemaPrivilegeCreateProjectionPolicy SchemaPrivilege = "CREATE PROJECTION POLICY"
SchemaPrivilegeCreateRowAccessPolicy SchemaPrivilege = "CREATE ROW ACCESS POLICY"
SchemaPrivilegeCreateSessionPolicy SchemaPrivilege = "CREATE SESSION POLICY"
SchemaPrivilegeCreateSecret SchemaPrivilege = "CREATE SECRET"
SchemaPrivilegeCreateSequence SchemaPrivilege = "CREATE SEQUENCE"
SchemaPrivilegeCreateService SchemaPrivilege = "CREATE SERVICE"
SchemaPrivilegeCreateSnapshot SchemaPrivilege = "CREATE SNAPSHOT"
SchemaPrivilegeCreateStage SchemaPrivilege = "CREATE STAGE"
SchemaPrivilegeCreateStream SchemaPrivilege = "CREATE STREAM"
SchemaPrivilegeCreateStreamlit SchemaPrivilege = "CREATE STREAMLIT"
SchemaPrivilegeCreateSnowflakeCoreBudget SchemaPrivilege = "CREATE SNOWFLAKE.CORE.BUDGET"
SchemaPrivilegeCreateSnowflakeMlAnomalyDetection SchemaPrivilege = "CREATE SNOWFLAKE.ML.ANOMALY_DETECTION"
SchemaPrivilegeCreateSnowflakeMlForecast SchemaPrivilege = "CREATE SNOWFLAKE.ML.FORECAST"
SchemaPrivilegeCreateDynamicTable SchemaPrivilege = "CREATE DYNAMIC TABLE"
SchemaPrivilegeCreateExternalTable SchemaPrivilege = "CREATE EXTERNAL TABLE"
SchemaPrivilegeCreateHybridTable SchemaPrivilege = "CREATE HYBRID TABLE"
SchemaPrivilegeCreateIcebergTable SchemaPrivilege = "CREATE ICEBERG TABLE"
SchemaPrivilegeCreateTable SchemaPrivilege = "CREATE TABLE"
SchemaPrivilegeCreateTag SchemaPrivilege = "CREATE TAG"
SchemaPrivilegeCreateTask SchemaPrivilege = "CREATE TASK"
SchemaPrivilegeCreateMaterializedView SchemaPrivilege = "CREATE MATERIALIZED VIEW"
SchemaPrivilegeCreateView SchemaPrivilege = "CREATE VIEW"
SchemaPrivilegeModify SchemaPrivilege = "MODIFY"
SchemaPrivilegeMonitor SchemaPrivilege = "MONITOR"
SchemaPrivilegeUsage SchemaPrivilege = "USAGE"
)
func (p SchemaPrivilege) String() string {
return string(p)
}
type SchemaObjectPrivilege string
const (
SchemaObjectOwnership SchemaObjectPrivilege = "OWNERSHIP"
// For ALERT
// SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "MONITOR" (duplicate)
SchemaObjectPrivilegeOperate SchemaObjectPrivilege = "OPERATE"
// For APPLICATION PACKAGE
SchemaObjectPrivilegeAttachListing SchemaObjectPrivilege = "ATTACH LISTING"
SchemaObjectPrivilegeDevelop SchemaObjectPrivilege = "DEVELOP"
SchemaObjectPrivilegeInstall SchemaObjectPrivilege = "INSTALL"
SchemaObjectPrivilegeManageVersions SchemaObjectPrivilege = "MANAGE VERSIONS"
SchemaObjectPrivilegeManageReleases SchemaObjectPrivilege = "MANAGE RELEASES"
// For DYNAMIC TABLE
// SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "MONITOR" (duplicate)
// SchemaObjectPrivilegeOperate SchemaObjectPrivilege = "OPERATE" (duplicate)
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// For CORTEX SEARCH SERVICE
// SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "USAGE" (duplicate)
// For EVENT TABLE
SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT"
SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT"
// For FILE FORMAT, FUNCTION (UDF or external function), PROCEDURE, SECRET, or SEQUENCE
SchemaObjectPrivilegeUsage SchemaObjectPrivilege = "USAGE"
// For HYBRID TABLE
// SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate)
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// SchemaObjectPrivilegeUpdate SchemaObjectPrivilege = "UPDATE" (duplicate)
// For IMAGE REPOSITORY
// SchemaObjectPrivilegeRead SchemaObjectPrivilege = "READ" (duplicate)
// SchemaObjectPrivilegeWrite SchemaObjectPrivilege = "WRITE" (duplicate)
// For ICEBERG TABLE
SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET"
// SchemaObjectPrivilegeDelete SchemaObjectPrivilege = "DELETE" (duplicate)
// SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate)
// SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES" (duplicate)
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// SchemaObjectPrivilegeTruncate SchemaObjectPrivilege = "TRUNCATE" (duplicate)
// SchemaObjectPrivilegeUpdate SchemaObjectPrivilege = "UPDATE" (duplicate)
// For PIPE
// SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET" (duplicate)
SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "MONITOR"
// SchemaObjectPrivilegeOperate SchemaObjectPrivilege = "OPERATE" (duplicate)
// For { MASKING | PASSWORD | ROW ACCESS | SESSION } POLICY or TAG
SchemaObjectPrivilegeApply SchemaObjectPrivilege = "APPLY"
// For external STAGE
// SchemaObjectPrivilegeUsage SchemaObjectPrivilege = "USAGE" (duplicate)
// For internal STAGE
SchemaObjectPrivilegeRead SchemaObjectPrivilege = "READ"
SchemaObjectPrivilegeWrite SchemaObjectPrivilege = "WRITE"
// For STREAM
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// For STREAMLIT
// SchemaObjectPrivilegeUsage SchemaObjectPrivilege = "USAGE" (duplicate)
// For TABLE
// SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET" (duplicate)
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate)
SchemaObjectPrivilegeEvolveSchema SchemaObjectPrivilege = "EVOLVE SCHEMA"
SchemaObjectPrivilegeUpdate SchemaObjectPrivilege = "UPDATE"
SchemaObjectPrivilegeDelete SchemaObjectPrivilege = "DELETE"
SchemaObjectPrivilegeTruncate SchemaObjectPrivilege = "TRUNCATE"
SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES"
// For Tag
// SchemaObjectPrivilegeRead SchemaObjectPrivilege = "READ" (duplicate)
// For TASK
// SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET" (duplicate)
// SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "MONITOR" (duplicate)
// SchemaObjectPrivilegeOperate SchemaObjectPrivilege = "OPERATE" (duplicate)
// For VIEW
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES" (duplicate)
// For MATERIALIZED VIEW
// SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET" (duplicate)
// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
// SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES" (duplicate)
)
func (p SchemaObjectPrivilege) String() string {
return string(p)
}
type ObjectPrivilege string
const (
ObjectPrivilegeReferenceUsage ObjectPrivilege = "REFERENCE_USAGE"
ObjectPrivilegeUsage ObjectPrivilege = "USAGE"
ObjectPrivilegeSelect ObjectPrivilege = "SELECT"
ObjectPrivilegeRead ObjectPrivilege = "READ"
)
func (p ObjectPrivilege) String() string {
return string(p)
}