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

Method ToRBAC

coderd/database/modelmethods.go:231–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229}
230
231func (s APIKeyScope) ToRBAC() rbac.ScopeName {
232 switch s {
233 case ApiKeyScopeCoderAll:
234 return rbac.ScopeAll
235 case ApiKeyScopeCoderApplicationConnect:
236 return rbac.ScopeApplicationConnect
237 default:
238 // Allow low-level resource:action scopes to flow through to RBAC for
239 // expansion via rbac.ExpandScope.
240 return rbac.ScopeName(s)
241 }
242}
243
244// APIKeyScopes represents a collection of individual API key scope names as
245// stored in the database. Helper methods on this type are used to derive the

Callers 1

expandRBACScopeMethod · 0.80

Calls 1

ScopeNameTypeAlias · 0.92

Tested by

no test coverage detected