server: Update permission checks for strict_readonly

This commit is contained in:
Valentin Tolmer
2022-07-08 18:30:15 +02:00
committed by nitnelave
parent 500a441df7
commit cf19fd41b0
4 changed files with 100 additions and 43 deletions

View File

@@ -113,13 +113,14 @@ impl<Handler: BackendHandler + Sync> Query<Handler> {
span.in_scope(|| {
debug!(?user_id);
});
let user_id = UserId::new(&user_id);
if !context.validation_result.can_read(&user_id) {
span.in_scope(|| debug!("Unauthorized"));
return Err("Unauthorized access to user data".into());
}
Ok(context
.handler
.get_user_details(&UserId::new(&user_id))
.get_user_details(&user_id)
.instrument(span)
.await
.map(Into::into)?)