MCPcopy Create free account
hub / github.com/coder/coder / TemplateConverter

Function TemplateConverter

coderd/rbac/regosql/configs.go:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func TemplateConverter() *sqltypes.VariableConverter {
30 matcher := sqltypes.NewVariableConverter().RegisterMatcher(
31 resourceIDMatcher(),
32 sqltypes.StringVarMatcher("t.organization_id :: text", []string{"input", "object", "org_owner"}),
33 // Templates have no user owner, only owner by an organization.
34 sqltypes.AlwaysFalse(userOwnerMatcher()),
35 )
36 matcher.RegisterMatcher(
37 groupACLMatcher(matcher),
38 userACLMatcher(matcher),
39 )
40 return matcher
41}
42
43func WorkspaceConverter() *sqltypes.VariableConverter {
44 matcher := sqltypes.NewVariableConverter().RegisterMatcher(

Callers 2

TestRegoQueriesFunction · 0.92

Calls 8

NewVariableConverterFunction · 0.92
StringVarMatcherFunction · 0.92
AlwaysFalseFunction · 0.92
resourceIDMatcherFunction · 0.85
userOwnerMatcherFunction · 0.85
groupACLMatcherFunction · 0.85
userACLMatcherFunction · 0.85
RegisterMatcherMethod · 0.80

Tested by 1

TestRegoQueriesFunction · 0.74