chore: remove limitations on private channels
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export version=0.5.3-alpha.13
|
export version=0.5.3-alpha.15
|
||||||
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ use serde::{Serialize, Deserialize};
|
|||||||
use validator::Contains;
|
use validator::Contains;
|
||||||
|
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
use crate::database::permissions::channel::ChannelPermission;
|
|
||||||
use crate::notifications::events::ClientboundNotification;
|
|
||||||
use crate::util::result::{Error, Result, EmptyResponse};
|
use crate::util::result::{Error, Result, EmptyResponse};
|
||||||
|
use crate::notifications::events::ClientboundNotification;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct Data {
|
pub struct Data {
|
||||||
@@ -34,7 +33,7 @@ pub async fn req(user: User, target: Ref, role: String, data: Json<Data>) -> Res
|
|||||||
return Err(Error::NotFound);
|
return Err(Error::NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
let permissions: u32 = ChannelPermission::View as u32 | data.permissions;
|
let permissions: u32 = data.permissions;
|
||||||
|
|
||||||
get_collection("channels")
|
get_collection("channels")
|
||||||
.update_one(
|
.update_one(
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<EmptyRespo
|
|||||||
return Err(Error::MissingPermission);
|
return Err(Error::MissingPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
let permissions: u32 = ChannelPermission::View as u32 | data.permissions;
|
let permissions: u32 = data.permissions;
|
||||||
|
|
||||||
get_collection("channels")
|
get_collection("channels")
|
||||||
.update_one(
|
.update_one(
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ use rocket::serde::json::Json;
|
|||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
use crate::database::permissions::channel::ChannelPermission;
|
|
||||||
use crate::database::permissions::server::ServerPermission;
|
|
||||||
use crate::notifications::events::ClientboundNotification;
|
use crate::notifications::events::ClientboundNotification;
|
||||||
use crate::util::result::{Error, Result, EmptyResponse};
|
use crate::util::result::{Error, Result, EmptyResponse};
|
||||||
|
|
||||||
@@ -36,8 +34,8 @@ pub async fn req(user: User, target: Ref, role_id: String, data: Json<Data>) ->
|
|||||||
return Err(Error::NotFound);
|
return Err(Error::NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
let server_permissions: u32 = ServerPermission::View as u32 | data.permissions.server;
|
let server_permissions: u32 = data.permissions.server;
|
||||||
let channel_permissions: u32 = ChannelPermission::View as u32 | data.permissions.channel;
|
let channel_permissions: u32 = data.permissions.channel;
|
||||||
|
|
||||||
get_collection("servers")
|
get_collection("servers")
|
||||||
.update_one(
|
.update_one(
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ use rocket::serde::json::Json;
|
|||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
use crate::database::permissions::channel::ChannelPermission;
|
|
||||||
use crate::database::permissions::server::ServerPermission;
|
|
||||||
use crate::notifications::events::ClientboundNotification;
|
use crate::notifications::events::ClientboundNotification;
|
||||||
use crate::util::result::{Error, Result, EmptyResponse};
|
use crate::util::result::{Error, Result, EmptyResponse};
|
||||||
|
|
||||||
@@ -32,8 +30,8 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<EmptyRespo
|
|||||||
return Err(Error::MissingPermission);
|
return Err(Error::MissingPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
let server_permissions: u32 = ServerPermission::View as u32 | data.permissions.server;
|
let server_permissions: u32 = data.permissions.server;
|
||||||
let channel_permissions: u32 = ChannelPermission::View as u32 | data.permissions.channel;
|
let channel_permissions: u32 = data.permissions.channel;
|
||||||
|
|
||||||
get_collection("servers")
|
get_collection("servers")
|
||||||
.update_one(
|
.update_one(
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
pub const VERSION: &str = "0.5.3-alpha.13";
|
pub const VERSION: &str = "0.5.3-alpha.15";
|
||||||
|
|||||||
Reference in New Issue
Block a user