Process permissions after conditional clauses

This commit is contained in:
Tobie Morgan Hitchcock 2021-10-08 16:04:08 +01:00
parent 1c917e7120
commit beb7862ae8
3 changed files with 6 additions and 6 deletions

View file

@ -142,13 +142,13 @@ func (d *document) runDelete(ctx context.Context, stm *sql.DeleteStatement) (int
return nil, nil return nil, nil
} }
if ok, err = d.allow(ctx, met); err != nil { if ok, err = d.check(ctx, stm.Cond); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil
} }
if ok, err = d.check(ctx, stm.Cond); err != nil { if ok, err = d.allow(ctx, met); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil

View file

@ -168,13 +168,13 @@ func (d *document) runSelect(ctx context.Context, stm *sql.SelectStatement) (int
return nil, nil return nil, nil
} }
if ok, err = d.allow(ctx, met); err != nil { if ok, err = d.check(ctx, stm.Cond); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil
} }
if ok, err = d.check(ctx, stm.Cond); err != nil { if ok, err = d.allow(ctx, met); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil

View file

@ -142,13 +142,13 @@ func (d *document) runUpdate(ctx context.Context, stm *sql.UpdateStatement) (int
met = _UPDATE met = _UPDATE
} }
if ok, err = d.allow(ctx, met); err != nil { if ok, err = d.check(ctx, stm.Cond); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil
} }
if ok, err = d.check(ctx, stm.Cond); err != nil { if ok, err = d.allow(ctx, met); err != nil {
return nil, err return nil, err
} else if ok == false { } else if ok == false {
return nil, nil return nil, nil