Condition queries must be treated as boolean values
This commit is contained in:
parent
cc5ba019e8
commit
9a4a6be868
1 changed files with 2 additions and 18 deletions
20
db/check.go
20
db/check.go
|
@ -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
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue