Ensure query auth level checks are logically correct
This commit is contained in:
parent
c57c313c47
commit
7e2eae32c5
2 changed files with 5 additions and 5 deletions
|
@ -26,10 +26,10 @@ impl Auth {
|
|||
pub fn check(&self, level: Level) -> bool {
|
||||
match self {
|
||||
Auth::No => matches!(level, Level::No),
|
||||
Auth::Kv => matches!(level, Level::No | Level::Kv),
|
||||
Auth::Ns(_) => matches!(level, Level::No | Level::Kv | Level::Ns),
|
||||
Auth::Db(_, _) => matches!(level, Level::No | Level::Kv | Level::Ns | Level::Db),
|
||||
Auth::Sc(_, _, _) => true,
|
||||
Auth::Sc(_, _, _) => matches!(level, Level::No | Level::Sc),
|
||||
Auth::Db(_, _) => matches!(level, Level::No | Level::Sc | Level::Db),
|
||||
Auth::Ns(_) => matches!(level, Level::No | Level::Sc | Level::Db | Level::Ns),
|
||||
Auth::Kv => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ fn process(
|
|||
) -> Session {
|
||||
// Create session
|
||||
let conf = Session {
|
||||
au: Auth::No,
|
||||
au: Auth::default(),
|
||||
ip: ip.map(|v| v.to_string()),
|
||||
or,
|
||||
id,
|
||||
|
|
Loading…
Reference in a new issue