Dynamic Page Permissions Question

Check by using code if the currently logged in user is the owner of the record you are about to show, if not show a box over the data that says “Permission Denied” and a link back to your main page. If it is the correct user don’t display the box so they can see the data.