Hey! To achieve that you can use the OnSelect property in combination with an "if-statement". How you are displaying the data from SharePoint? In a Gallery? If so, you can try something like this:
If the button is part of your Gallery item: If(yourEmailVariable = ThisItem.'Posted By'.Email, Navigate(Page1), Navigate(Page2))
If the button is not part of your Gallery: If(yourEmailVariable = YourGalleryName.Selected.'Posted By'.Email, Navigate(Page1), Navigate(Page2))
Instead of using a variable for the email you could also user user().email to get the currents user's mail address.
Let me know if this helps you.