oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package equipo
2
3import (
4 "context"
5
6 "amadan.net/oficina/equipo/internal/equipo/ownermode"
7 "gorm.io/gorm"
8)
9
10func (e *Execution) ownerDefaults(ctx context.Context, tx *gorm.DB, sel Selection) error {
11 if sel.Isolation.Mode != "owner mode" {
12 return nil
13 }
14 instance, err := runnerInstance(tx)
15 if err != nil {
16 return err
17 }
18 runner, err := runnerAt(tx, instance, sel.RunnerID)
19 if err != nil {
20 return err
21 }
22 if runner.Person != sel.Person {
23 return ErrForbidden
24 }
25 if _, err = currentRunnerMember(tx, sel.Person); err != nil {
26 return err
27 }
28 return ownermode.Defaults(ctx, tx, e.Core, instance, sel, executionTx, appendAudit)
29}
30