server
Some checks failed
Build and publish Docker image / build-and-push (push) Failing after 6m7s
CI / Check (push) Failing after 7m21s

This commit is contained in:
Andras Schmelczer 2026-05-31 13:19:26 +01:00
parent 8dc939d761
commit d98819b569
12 changed files with 157 additions and 161 deletions

View file

@ -55,6 +55,16 @@ pub async fn get_actual_listings(
) -> Result<Json<ActualListingsResponse>, Response> {
let state = shared.load_state();
let offset = params.offset.unwrap_or(0);
// Gate the entire feature behind the per-user `can_see_listings` flag. The
// flag is off by default for everyone, so listings are invisible unless a
// superuser has explicitly granted access to this account.
if !user.0.as_ref().is_some_and(|u| u.can_see_listings) {
return Err(
ApiError::Forbidden("You do not have access to listings".to_string()).into_response(),
);
}
let Some(actual_listings) = state.actual_listings.clone() else {
return Ok(Json(ActualListingsResponse {
listings: Vec::new(),