Make cancellation policy read endpoint public
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-02-02 09:34:58 +05:30
parent 4c20cbd7ca
commit 734591807f
2 changed files with 2 additions and 1 deletions

View File

@@ -35,7 +35,6 @@ class CancellationPolicies(
@PathVariable propertyId: UUID,
@AuthenticationPrincipal principal: MyPrincipal?
): CancellationPolicyResponse {
requireRole(propertyAccess, propertyId, principal, Role.ADMIN, Role.MANAGER, Role.FINANCE)
val policy = policyRepo.findByPropertyId(propertyId)
return if (policy != null) {
CancellationPolicyResponse(

View File

@@ -13,6 +13,7 @@ internal object PublicEndpoints {
private val razorpayWebhook = Regex("^/properties/[^/]+/razorpay/webhook$")
private val razorpayReturn = Regex("^/properties/[^/]+/razorpay/return/(success|failure)$")
private val guestDocumentFile = Regex("^/properties/[^/]+/guests/[^/]+/documents/[^/]+/file$")
private val cancellationPolicy = Regex("^/properties/[^/]+/cancellation-policy$")
fun isPublic(request: HttpServletRequest): Boolean {
val path = request.requestURI
@@ -32,5 +33,6 @@ internal object PublicEndpoints {
|| path == "/icons/png"
|| iconPngFile.matches(path)
|| guestDocumentFile.matches(path)
|| (cancellationPolicy.matches(path) && method == "GET")
}
}