Iframe with user permission

Hello,
is it possible to crate iframe with specific html code for specific user and for another user show a different html code on the same iframe?
I want to crate iframe that identify who the user using the website and put a specific code according to the user.

any idea ?