Ensure permissions are not chekced on PERMISSIONS clauses

Closes #1633
This commit is contained in:
Tobie Morgan Hitchcock 2023-02-12 11:48:11 +00:00
parent ea84f839da
commit 1e93c0f304
3 changed files with 5 additions and 1 deletions

View file

@ -33,7 +33,7 @@ impl<'a> Document<'a> {
Permission::None => return Err(Error::Ignore),
Permission::Full => return Ok(()),
Permission::Specific(e) => {
// Ensure permissions are disabled
// Disable permissions
let opt = &opt.perms(false);
// Process the PERMISSION clause
if !e.compute(ctx, opt, txn, Some(&self.current)).await?.is_truthy() {

View file

@ -77,6 +77,8 @@ impl<'a> Document<'a> {
Permission::Full => (),
Permission::None => val = old,
Permission::Specific(e) => {
// Disable permissions
let opt = &opt.perms(false);
// Configure the context
let mut ctx = Context::new(ctx);
ctx.add_value("value".into(), &val);

View file

@ -62,6 +62,8 @@ impl<'a> Document<'a> {
Permission::Full => (),
Permission::None => out.del(ctx, opt, txn, k).await?,
Permission::Specific(e) => {
// Disable permissions
let opt = &opt.perms(false);
// Get the current value
let val = self.current.pick(k);
// Configure the context