Don’t run permissions on DEFINE EVENT and DEFINE TABLE queries

Closes #1570
This commit is contained in:
Tobie Morgan Hitchcock 2023-01-01 12:24:47 +00:00
parent 4ffeefb537
commit b8c5f23d56
2 changed files with 4 additions and 0 deletions

View file

@ -23,6 +23,8 @@ impl<'a> Document<'a> {
if !opt.force && !self.changed() { if !opt.force && !self.changed() {
return Ok(()); return Ok(());
} }
// Don't run permissions
let opt = &opt.perms(false);
// Loop through all event statements // Loop through all event statements
for ev in self.ev(opt, txn).await?.iter() { for ev in self.ev(opt, txn).await?.iter() {
// Get the event action // Get the event action

View file

@ -44,6 +44,8 @@ impl<'a> Document<'a> {
if !opt.force && !self.changed() { if !opt.force && !self.changed() {
return Ok(()); return Ok(());
} }
// Don't run permissions
let opt = &opt.perms(false);
// Get the record id // Get the record id
let rid = self.id.as_ref().unwrap(); let rid = self.id.as_ref().unwrap();
// Get the query action // Get the query action