MCPcopy Create free account
hub / github.com/bytebase/bytebase / formatEffectiveQueryDataPolicy

Function formatEffectiveQueryDataPolicy

backend/store/policy.go:204–216  ·  view source on GitHub ↗
(policy *storepb.QueryDataPolicy)

Source from the content-addressed store, hash-verified

202}
203
204func formatEffectiveQueryDataPolicy(policy *storepb.QueryDataPolicy) *EffectiveQueryDataPolicy {
205 maximumResultRows := policy.GetMaximumResultRows()
206 if maximumResultRows <= 0 {
207 maximumResultRows = math.MaxInt32
208 }
209
210 return &EffectiveQueryDataPolicy{
211 MaximumResultRows: maximumResultRows,
212 DisableCopyData: policy.GetDisableCopyData(),
213 DisableExport: policy.GetDisableExport(),
214 AllowAdminDataSource: policy.GetAllowAdminDataSource(),
215 }
216}
217
218func (s *Store) GetEffectiveQueryDataPolicy(ctx context.Context, workspaceID string, projectFullName string) (*EffectiveQueryDataPolicy, error) {
219 workspaceResource := common.FormatWorkspace(workspaceID)

Callers 1

Calls 4

GetMaximumResultRowsMethod · 0.45
GetDisableCopyDataMethod · 0.45
GetDisableExportMethod · 0.45

Tested by

no test coverage detected