i have this controller with Spring @PreAuthorize annotation:
@PreAuthorize("hasRole('ROLE_USER') and #id == authentication.name")
public ResponseEntity<UserProfileDTO> updateProfile(@PathVariable(name = "id") final UUID id) {
//service call
}
but the problem is, that principal is String, and equals return false. How i can call java.util.UUID.fromString(authentication.name) ?