Skip to content
Snippets Groups Projects
Commit 96c9190f authored by insert's avatar insert
Browse files

Fix: Allow users with server overlap to access each other.

parent e452d6a3
Branches
Tags
No related merge requests found
Pipeline #1243 passed with stage
in 10 minutes and 35 seconds
#!/bin/bash
export version=0.5.1-alpha.3
export version=0.5.1-alpha.4
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
......@@ -69,7 +69,31 @@ impl<'a> PermissionCalculator<'a> {
_ => {}
}
let check_server_overlap = async || {
let server_ids = self.perspective.fetch_server_ids().await?;
Ok(
get_collection("server_members")
.find_one(
doc! {
"_id.user": &target,
"_id.server": {
"$in": server_ids
}
},
None
)
.await
.map_err(|_| Error::DatabaseError {
operation: "find_one",
with: "server_members",
})?
.is_some()
)
};
if self.has_mutual_connection
|| check_server_overlap().await?
|| get_collection("channels")
.find_one(
doc! {
......@@ -84,7 +108,7 @@ impl<'a> PermissionCalculator<'a> {
)
.await
.map_err(|_| Error::DatabaseError {
operation: "find",
operation: "find_one",
with: "channels",
})?
.is_some()
......
pub const VERSION: &str = "0.5.1-alpha.3";
pub const VERSION: &str = "0.5.1-alpha.4";
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment