Add runtime option for disabling permission checks
This commit is contained in:
parent
1ea692d32e
commit
41c44ea709
1 changed files with 14 additions and 0 deletions
|
@ -25,6 +25,8 @@ pub struct Options {
|
||||||
pub debug: bool,
|
pub debug: bool,
|
||||||
// Should we force tables/events to re-run?
|
// Should we force tables/events to re-run?
|
||||||
pub force: bool,
|
pub force: bool,
|
||||||
|
// Should we run permissions checks?
|
||||||
|
pub perms: bool,
|
||||||
// Should we process field queries?
|
// Should we process field queries?
|
||||||
pub fields: bool,
|
pub fields: bool,
|
||||||
// Should we process event queries?
|
// Should we process event queries?
|
||||||
|
@ -48,6 +50,7 @@ impl Options {
|
||||||
ns: None,
|
ns: None,
|
||||||
db: None,
|
db: None,
|
||||||
dive: 0,
|
dive: 0,
|
||||||
|
perms: true,
|
||||||
debug: false,
|
debug: false,
|
||||||
force: false,
|
force: false,
|
||||||
fields: true,
|
fields: true,
|
||||||
|
@ -107,6 +110,17 @@ impl Options {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a new Options object for a subquery
|
||||||
|
pub fn perms(&self, v: bool) -> Options {
|
||||||
|
Options {
|
||||||
|
auth: self.auth.clone(),
|
||||||
|
ns: self.ns.clone(),
|
||||||
|
db: self.db.clone(),
|
||||||
|
perms: v,
|
||||||
|
..*self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create a new Options object for a subquery
|
// Create a new Options object for a subquery
|
||||||
pub fn fields(&self, v: bool) -> Options {
|
pub fn fields(&self, v: bool) -> Options {
|
||||||
Options {
|
Options {
|
||||||
|
|
Loading…
Reference in a new issue