Allow switching to current namespace when authenticated as a database user

This commit is contained in:
Tobie Morgan Hitchcock 2022-09-10 05:45:02 +01:00
parent eba00bbca3
commit 3b41217423

View file

@ -197,6 +197,7 @@ impl<'a> Executor<'a> {
Auth::No => self.set_ns(&mut ctx, &mut opt, ns).await, Auth::No => self.set_ns(&mut ctx, &mut opt, ns).await,
Auth::Kv => self.set_ns(&mut ctx, &mut opt, ns).await, Auth::Kv => self.set_ns(&mut ctx, &mut opt, ns).await,
Auth::Ns(v) if v == ns => self.set_ns(&mut ctx, &mut opt, ns).await, Auth::Ns(v) if v == ns => self.set_ns(&mut ctx, &mut opt, ns).await,
Auth::Db(v, _) if v == ns => self.set_ns(&mut ctx, &mut opt, ns).await,
_ => { _ => {
opt.ns = None; opt.ns = None;
return Err(Error::NsNotAllowed { return Err(Error::NsNotAllowed {