Allow public access to room image files endpoint
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
This commit is contained in:
@@ -130,8 +130,9 @@ class RoomImages(
|
|||||||
@RequestParam(required = false, defaultValue = "full") size: String,
|
@RequestParam(required = false, defaultValue = "full") size: String,
|
||||||
@AuthenticationPrincipal principal: MyPrincipal?
|
@AuthenticationPrincipal principal: MyPrincipal?
|
||||||
): ResponseEntity<FileSystemResource> {
|
): ResponseEntity<FileSystemResource> {
|
||||||
requirePrincipal(principal)
|
if (principal != null) {
|
||||||
propertyAccess.requireMember(propertyId, principal!!.userId)
|
propertyAccess.requireMember(propertyId, principal.userId)
|
||||||
|
}
|
||||||
ensureRoom(propertyId, roomId)
|
ensureRoom(propertyId, roomId)
|
||||||
|
|
||||||
val image = roomImageRepo.findByIdAndRoomIdAndPropertyId(imageId, roomId, propertyId)
|
val image = roomImageRepo.findByIdAndRoomIdAndPropertyId(imageId, roomId, propertyId)
|
||||||
|
|||||||
Reference in New Issue
Block a user