Hi all, is it any role management in ktor? Somethi...
# ktor
t
Hi all, is it any role management in ktor? Something like in Spring @hasRole or @preauthorized?
n
I do not believe so (this could have changed in a recent release), but it's not too difficult to bootstrap one. I ended up writing a custom route selector that returns
RouteSelectorEvaluation.Constant
if the user has the role and
RouteSelectorEvaluation.Failed
otherwise. You could do a similar thing with interception. See: https://ktor.io/servers/features/routing.html The Interception heading particularly talks about verifying admin privileges.