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

Method Authorize

coderd/coderdtest/authorize.go:347–356  ·  view source on GitHub ↗
(ctx context.Context, object rbac.Object)

Source from the content-addressed store, hash-verified

345}
346
347func (s *PreparedRecorder) Authorize(ctx context.Context, object rbac.Object) error {
348 s.rw.Lock()
349 defer s.rw.Unlock()
350
351 authzErr := s.prepped.Authorize(ctx, object)
352 if !s.usingSQL {
353 s.rec.recordAuthorize(s.subject, s.action, object, authzErr)
354 }
355 return authzErr
356}
357
358func (s *PreparedRecorder) CompileToSQL(ctx context.Context, cfg regosql.ConvertConfig) (string, error) {
359 s.rw.Lock()

Callers

nothing calls this directly

Calls 4

recordAuthorizeMethod · 0.80
AuthorizeMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected