Allow public room types list
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
This commit is contained in:
@@ -40,8 +40,9 @@ class RoomTypes(
|
|||||||
@PathVariable propertyId: UUID,
|
@PathVariable propertyId: UUID,
|
||||||
@AuthenticationPrincipal principal: MyPrincipal?
|
@AuthenticationPrincipal principal: MyPrincipal?
|
||||||
): List<RoomTypeResponse> {
|
): List<RoomTypeResponse> {
|
||||||
requirePrincipal(principal)
|
if (principal != null) {
|
||||||
propertyAccess.requireMember(propertyId, principal!!.userId)
|
propertyAccess.requireMember(propertyId, principal.userId)
|
||||||
|
}
|
||||||
return roomTypeRepo.findByPropertyIdOrderByCode(propertyId).map { it.toResponse() }
|
return roomTypeRepo.findByPropertyIdOrderByCode(propertyId).map { it.toResponse() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class FirebaseAuthFilter(
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return path.matches(Regex("^/properties/[^/]+/rooms/[^/]+/images/[^/]+/file$"))
|
return path.matches(Regex("^/properties/[^/]+/rooms/[^/]+/images/[^/]+/file$"))
|
||||||
|
|| path.matches(Regex("^/properties/[^/]+/room-types$"))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doFilterInternal(
|
override fun doFilterInternal(
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class SecurityConfig(
|
|||||||
.authorizeHttpRequests {
|
.authorizeHttpRequests {
|
||||||
it.requestMatchers("/", "/health", "/auth/**").permitAll()
|
it.requestMatchers("/", "/health", "/auth/**").permitAll()
|
||||||
it.requestMatchers("/properties/*/rooms/*/images/*/file").permitAll()
|
it.requestMatchers("/properties/*/rooms/*/images/*/file").permitAll()
|
||||||
|
it.requestMatchers("/properties/*/room-types").permitAll()
|
||||||
it.anyRequest().authenticated()
|
it.anyRequest().authenticated()
|
||||||
}
|
}
|
||||||
.exceptionHandling {
|
.exceptionHandling {
|
||||||
|
|||||||
Reference in New Issue
Block a user