1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 22:29:45 +00:00

Validate that a user can see another user's page

This commit is contained in:
2020-05-29 18:26:45 +02:00
parent cf2d9606d9
commit 253d33ef7d
2 changed files with 36 additions and 0 deletions

View File

@@ -50,6 +50,9 @@ pub fn get_multiple(request: &mut HttpRequestHandler) -> RequestResult {
pub fn get_advanced_info(request: &mut HttpRequestHandler) -> RequestResult {
let user_id = request.post_user_id("userID")?;
if !user_helper::can_see_user_page(request.user_id_opt().unwrap_or(0), user_id)? {
request.forbidden("You are not allowed to see this user page!".to_string())?;
}
request.success("get user info")
}