fix: don't allow users to read posts from communities with strict read
access
This commit is contained in:
parent
7b4865333e
commit
30b23660b6
5 changed files with 36 additions and 16 deletions
|
@ -551,6 +551,12 @@ pub async fn post_request(
|
|||
// check permissions
|
||||
let (can_read, can_manage_pins) = check_permissions!(community, jar, data, user);
|
||||
|
||||
if !can_read {
|
||||
return Err(Html(
|
||||
render_error(Error::NotAllowed, &jar, &data, &user).await,
|
||||
));
|
||||
}
|
||||
|
||||
// ...
|
||||
let feed = match data.0.get_post_comments(post.id, 12, props.page).await {
|
||||
Ok(p) => match data.0.fill_posts(p).await {
|
||||
|
@ -736,6 +742,12 @@ pub async fn question_request(
|
|||
// check permissions
|
||||
let (can_read, _) = check_permissions!(community, jar, data, user);
|
||||
|
||||
if !can_read {
|
||||
return Err(Html(
|
||||
render_error(Error::NotAllowed, &jar, &data, &user).await,
|
||||
));
|
||||
}
|
||||
|
||||
// ...
|
||||
let feed = match data
|
||||
.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue