Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename authz err
  • Loading branch information
Emyrk committed Apr 8, 2025
commit 6ac8a927d94362edd64404375d74d86cdff21c09
12 changes: 6 additions & 6 deletions coderd/coderdtest/authorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ func (r *RecordingAuthorizer) Authorize(ctx context.Context, subject rbac.Subjec
if r.Wrapped == nil {
panic("Developer error: RecordingAuthorizer.Wrapped is nil")
}
err := r.Wrapped.Authorize(ctx, subject, action, object)
r.recordAuthorize(subject, action, object, err)
return err
authzErr := r.Wrapped.Authorize(ctx, subject, action, object)
r.recordAuthorize(subject, action, object, authzErr)
return authzErr
}

func (r *RecordingAuthorizer) Prepare(ctx context.Context, subject rbac.Subject, action policy.Action, objectType string) (rbac.PreparedAuthorized, error) {
Expand Down Expand Up @@ -344,11 +344,11 @@ func (s *PreparedRecorder) Authorize(ctx context.Context, object rbac.Object) er
s.rw.Lock()
defer s.rw.Unlock()

err := s.prepped.Authorize(ctx, object)
authzErr := s.prepped.Authorize(ctx, object)
if !s.usingSQL {
s.rec.recordAuthorize(s.subject, s.action, object, err)
s.rec.recordAuthorize(s.subject, s.action, object, authzErr)
}
return err
return authzErr
}

func (s *PreparedRecorder) CompileToSQL(ctx context.Context, cfg regosql.ConvertConfig) (string, error) {
Expand Down