Fixing bad location index
Deploy Promiscuity Auth API / deploy (push) Successful in 45s
Deploy Promiscuity Character API / deploy (push) Successful in 57s
Deploy Promiscuity Locations API / deploy (push) Successful in 57s
k8s smoke test / test (push) Successful in 8s

This commit is contained in:
2026-03-13 21:26:36 -05:00
parent 9b646f501c
commit 6ca0f306bb
3 changed files with 170 additions and 63 deletions
@@ -64,9 +64,23 @@ public class CharactersController : ControllerBase
return Unauthorized();
var allowAnyOwner = User.IsInRole("SUPER");
var character = await _characters.GetForOwnerByIdAsync(id, userId, allowAnyOwner);
var character = await _characters.GetByIdAsync(id);
if (character is null)
{
_logger.LogWarning("Visible locations request failed: character {CharacterId} was not found.", id);
return NotFound();
}
if (!allowAnyOwner && character.OwnerUserId != userId)
{
_logger.LogWarning(
"Visible locations request denied: character {CharacterId} belongs to owner {OwnerUserId}, request user was {UserId}",
id,
character.OwnerUserId,
userId
);
return Forbid();
}
_logger.LogInformation(
"Visible locations requested for character {CharacterId} at ({X},{Y}) radius {VisionRadius} by user {UserId}",