From 2b7a23c56990baa3f401d3c4f52b0be4832faad9 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 4 Apr 2022 19:51:37 +0100 Subject: [PATCH] Make DEFINE TABLE and DEFINE FIELD permissions FULL by default --- lib/src/sql/permission.rs | 2 +- lib/src/sql/statements/define.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/src/sql/permission.rs b/lib/src/sql/permission.rs index 94d6a867..bf5b893d 100644 --- a/lib/src/sql/permission.rs +++ b/lib/src/sql/permission.rs @@ -143,7 +143,7 @@ pub enum Permission { impl Default for Permission { fn default() -> Self { - Permission::None + Permission::Full } } diff --git a/lib/src/sql/statements/define.rs b/lib/src/sql/statements/define.rs index 2e24899d..3f1f6483 100644 --- a/lib/src/sql/statements/define.rs +++ b/lib/src/sql/statements/define.rs @@ -622,7 +622,9 @@ impl fmt::Display for DefineTableStatement { if let Some(ref v) = self.view { write!(f, " {}", v)? } - write!(f, " {}", self.permissions)?; + if !self.permissions.is_full() { + write!(f, " {}", self.permissions)?; + } Ok(()) } } @@ -840,7 +842,9 @@ impl fmt::Display for DefineFieldStatement { if let Some(ref v) = self.assert { write!(f, " ASSERT {}", v)? } - write!(f, " {}", self.permissions)?; + if !self.permissions.is_full() { + write!(f, " {}", self.permissions)?; + } Ok(()) } }