I've created a checkPostOwnershipWebFilter (checkP...
# codereview
d
I've created a checkPostOwnershipWebFilter (checkPostOwnership) to check if the Post to be updated or deleted is owned by the logged in user. How does it look to you ? Could I do better ? : https://github.com/danygiguere/spring-boot-3-reactive-with-kotlin-coroutines/commit/ad39b35d255afc55e6279dcae974490fd0838584#diff-c6813[…]94512d8R36
k
It looks good; nothing particularly wrong, but I left some minor comments.
🙏 1
s
tiny general tip: Spring nowadays has handful of Kotlin utils making it easier to integrate with kotlin-first features. I would guess most of it is listed in this part of the docs and it's worth giving it a look sometimes 🙂 For your case, CoWebFilter could be used instead of regular
WebFilter
to save you from dealing with Reactor types yourself. There are also mini extensions like ServerWebExchange.awaitPrincipal which could come in handy in your case
👍 1
d
thanks a lot @Klitos Kyriacou :)
thanks @Szymon Jeziorski I'll look into it.