No need to pass $before and $after values for determining permissions

This commit is contained in:
Tobie Morgan Hitchcock 2019-11-18 11:36:12 +00:00
parent cca75c70fc
commit ddf87a7188

View file

@ -74,16 +74,8 @@ func (d *document) perms(ctx context.Context, doc *data.Doc) (err error) {
if p, ok := fd.Perms.(*sql.PermExpression); ok { if p, ok := fd.Perms.(*sql.PermExpression); ok {
// Get the old value
old := d.initial.Get(key).Data()
// Reset the variables
vars := data.New() vars := data.New()
vars.Set(val, varKeyValue) vars.Set(val, varKeyValue)
vars.Set(val, varKeyAfter)
vars.Set(old, varKeyBefore)
ctx = context.WithValue(ctx, ctxKeySpec, vars) ctx = context.WithValue(ctx, ctxKeySpec, vars)
if v, err := d.i.e.fetch(ctx, p.Select, doc); err != nil { if v, err := d.i.e.fetch(ctx, p.Select, doc); err != nil {