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() {
return Ok(());
}
// Don't run permissions
let opt = &opt.perms(false);
// Loop through all event statements
for ev in self.ev(opt, txn).await?.iter() {
// Get the event action

View file

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