Condition queries must be treated as boolean values

This commit is contained in:
Tobie Morgan Hitchcock 2020-11-24 12:48:41 +00:00
parent cc5ba019e8
commit 9a4a6be868

View file

@ -111,15 +111,7 @@ func (d *document) grant(ctx context.Context, met method) (ok bool, err error) {
// return this, dictating whether the
// document is able to be viewed.
if v, ok := val.(bool); ok {
return v, err
}
// Otherwise as this request is scoped,
// return an error, so that the
// document is unable to be viewed.
return false, err
return calcAsBool(val), err
}
@ -198,14 +190,6 @@ func (d *document) allow(ctx context.Context, met method) (ok bool, err error) {
// return this, dictating whether the
// document is able to be viewed.
if v, ok := val.(bool); ok {
return v, err
}
// Otherwise as this request is scoped,
// return an error, so that the
// document is unable to be viewed.
return false, err
return calcAsBool(val), err
}