(skip int)
| 282 | } |
| 283 | |
| 284 | func caller(skip int) string { |
| 285 | pc, file, line, ok := runtime.Caller(skip + 1) |
| 286 | i := strings.Index(file, "coder") |
| 287 | if i >= 0 { |
| 288 | file = file[i:] |
| 289 | } |
| 290 | str := fmt.Sprintf("%s:%d", file, line) |
| 291 | if ok { |
| 292 | f := runtime.FuncForPC(pc) |
| 293 | str += " | " + filepath.Base(f.Name()) |
| 294 | } |
| 295 | return str |
| 296 | } |
| 297 | |
| 298 | func (r *RecordingAuthorizer) Authorize(ctx context.Context, subject rbac.Subject, action policy.Action, object rbac.Object) error { |
| 299 | if r.Wrapped == nil { |