@PatchMapping("/add")
fun addUserToRole(
@RequestParam username: String,
@RequestParam roleName: String,
): Boolean {
val role = roleService.getRole(roleName)
val user = userService.getUser(username)
user.roles.add(role)
userService.updateUser(user)
return true
}
So I'm trying to add roles using the Java sdk in Kotlin. Is this how it's supposed to be done? I get the role and admin each and update the user with the role and use the update method in the userService. It doesn't seem to work
