I'm not sure how others do it, but I would have a controller with methods like showList, showForm, validateForm, saveForm?
I'm
also guessing that you get to showForm from a link in the list
displayed by showList which has the url to get to showForm with all the
necessary query params.
If so, you can test in showForm...
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
$id_user = $user->get('id');
$record_owner_id = $jinput->get('id', '', 'INT');
if ($record_owner_id != $id_user) {
// create view object for read only display
$view->display();
} else {
// create view object to show edit form
}
$view->display();