Skip to content

Commit

Permalink
review edits
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Feb 26, 2024
1 parent 571072a commit 96da442
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libsql-server/src/auth/authenticated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ impl Authenticated {
)),
Authenticated::Authorized(a) => {
if !a.has_right(Scope::Namespace(namespace.clone()), perm) {
return Err(crate::Error::NotAuthorized(format!(
"Current session doest not have {perm:?} permission to namespace {namespace}")));
Err(crate::Error::NotAuthorized(format!(
"Current session doest not have {perm:?} permission to namespace {namespace}")))
} else {
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions libsql-server/src/auth/authorized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ impl Authorized {
pub fn merge_legacy(&mut self, namespace: NamespaceName, perm: Permission) {
let scope = match perm {
Permission::Read => self.read_only.get_or_insert_with(Default::default),
Permission::Write => self.read_only.get_or_insert_with(Default::default),
Permission::AttachRead => todo!("unsupported"),
Permission::Write => self.read_write.get_or_insert_with(Default::default),
Permission::AttachRead => self.read_only_attach.get_or_insert_with(Default::default),
};

scope
Expand Down

0 comments on commit 96da442

Please sign in to comment.