Include group members in payload.

This commit is contained in:
Paul Makles
2021-01-26 22:05:32 +00:00
parent f42480886b
commit 3b85dcce14
15 changed files with 179 additions and 109 deletions

View File

@@ -9,7 +9,8 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -9,7 +9,8 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -13,7 +13,8 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
let channel = target.fetch_channel().await?;
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&channel)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -9,7 +9,8 @@ pub async fn req(user: User, target: Ref, msg: Ref) -> Result<()> {
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&channel)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -21,7 +21,8 @@ pub async fn req(user: User, target: Ref, msg: Ref, edit: Json<Data>) -> Result<
let channel = target.fetch_channel().await?;
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&channel)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -9,7 +9,8 @@ pub async fn req(user: User, target: Ref, msg: Ref) -> Result<JsonValue> {
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&channel)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -31,7 +31,8 @@ pub async fn req(user: User, target: Ref, options: Form<Options>) -> Result<Json
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_view() {
Err(Error::LabelMe)?
}

View File

@@ -26,7 +26,8 @@ pub async fn req(user: User, target: Ref, message: Json<Data>) -> Result<JsonVal
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel().await?;
.for_channel()
.await?;
if !perm.get_send_message() {
Err(Error::LabelMe)?
}