fix checking of master key as per review comment

This commit is contained in:
vishalsodani 2022-10-27 12:56:18 +05:30
parent f0ecacb58d
commit 9cf3ff72a3
2 changed files with 13 additions and 30 deletions

View file

@ -173,28 +173,13 @@ impl AuthController {
pub struct AuthFilter {
pub search_rules: SearchRules,
pub allow_index_creation: bool,
master_key_missing: bool,
}
impl AuthFilter {
pub fn with_no_master_key() -> AuthFilter {
AuthFilter {
search_rules: SearchRules::default(),
allow_index_creation: true,
master_key_missing: true,
}
}
pub fn is_missing_master_key(&self) -> bool {
self.master_key_missing
}
}
impl Default for AuthFilter {
fn default() -> Self {
Self {
search_rules: SearchRules::default(),
allow_index_creation: true,
master_key_missing: false,
}
}
}