()
| 229 | } |
| 230 | |
| 231 | func (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 |
no test coverage detected