Allow public access to room image files endpoint
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s

This commit is contained in:
androidlover5842
2026-01-27 17:11:17 +05:30
parent 64655b7b30
commit d4f8ea96e0

View File

@@ -130,8 +130,9 @@ class RoomImages(
@RequestParam(required = false, defaultValue = "full") size: String,
@AuthenticationPrincipal principal: MyPrincipal?
): ResponseEntity<FileSystemResource> {
requirePrincipal(principal)
propertyAccess.requireMember(propertyId, principal!!.userId)
if (principal != null) {
propertyAccess.requireMember(propertyId, principal.userId)
}
ensureRoom(propertyId, roomId)
val image = roomImageRepo.findByIdAndRoomIdAndPropertyId(imageId, roomId, propertyId)