diff --git a/db/delete.go b/db/delete.go index 86862ff4..c94fef7c 100644 --- a/db/delete.go +++ b/db/delete.go @@ -142,13 +142,13 @@ func (d *document) runDelete(ctx context.Context, stm *sql.DeleteStatement) (int 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 } else if ok == false { 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 } else if ok == false { return nil, nil diff --git a/db/select.go b/db/select.go index 1bd9ad0d..5163f426 100644 --- a/db/select.go +++ b/db/select.go @@ -168,13 +168,13 @@ func (d *document) runSelect(ctx context.Context, stm *sql.SelectStatement) (int 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 } else if ok == false { 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 } else if ok == false { return nil, nil diff --git a/db/update.go b/db/update.go index 04d5d635..e6f1b949 100644 --- a/db/update.go +++ b/db/update.go @@ -142,13 +142,13 @@ func (d *document) runUpdate(ctx context.Context, stm *sql.UpdateStatement) (int met = _UPDATE } - if ok, err = d.allow(ctx, met); err != nil { + if ok, err = d.check(ctx, stm.Cond); err != nil { return nil, err } else if ok == false { 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 } else if ok == false { return nil, nil