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,
|
||||
// Should we force tables/events to re-run?
|
||||
pub force: bool,
|
||||
// Should we run permissions checks?
|
||||
pub perms: bool,
|
||||
// Should we process field queries?
|
||||
pub fields: bool,
|
||||
// Should we process event queries?
|
||||
|
@ -48,6 +50,7 @@ impl Options {
|
|||
ns: None,
|
||||
db: None,
|
||||
dive: 0,
|
||||
perms: true,
|
||||
debug: false,
|
||||
force: false,
|
||||
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
|
||||
pub fn fields(&self, v: bool) -> Options {
|
||||
Options {
|
||||
|
|
Loading…
Reference in a new issue