As per my understanding, following scenario is not possible in a provided hosted app deployed for SharePoint 2013 on-premises.
1) User clicks the button of app on a SharePoint Site. Remote Web app page opens
2) Remote app page shows the message "Welcome [User Name]" (without authenticating user again)
3) If that user has contributor permissions in originating SharePoint site, the app should display "Welcome Contributor" otherwise it should display "Welcome Visitor"
Please let me know if above functionality could be achieved?
Hammad Arif EPM Advice Blog