MCPcopy Index your code
hub / github.com/coder/coder / UserConverter

Function UserConverter

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

Source from the content-addressed store, hash-verified

126}
127
128func UserConverter() *sqltypes.VariableConverter {
129 matcher := sqltypes.NewVariableConverter().RegisterMatcher(
130 resourceIDMatcher(),
131 // Users are never owned by an organization, so always return the empty string
132 // for the org owner.
133 sqltypes.StringVarMatcher("''", []string{"input", "object", "org_owner"}),
134 // Users are always owned by themselves.
135 sqltypes.StringVarMatcher("id :: text", []string{"input", "object", "owner"}),
136 )
137 matcher.RegisterMatcher(
138 // No ACLs on the user type
139 sqltypes.AlwaysFalse(groupACLMatcher(matcher)),
140 sqltypes.AlwaysFalse(userACLMatcher(matcher)),
141 )
142 return matcher
143}
144
145// NoACLConverter should be used when the target SQL table does not contain
146// group or user ACL columns.

Callers 2

TestRegoQueriesFunction · 0.92
GetAuthorizedUsersMethod · 0.92

Calls 7

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

Tested by 1

TestRegoQueriesFunction · 0.74