There are modern theories of ethics that say, "If your goals are good, no one is hurt, and if your motivation is love, then you are free to do whatever you want." Joseph didn't let his situation determine his ethics. He maintained his beliefs regardless of how the circumstances changed. Covers Genesis 39:13-23.
From the series God Meant it For Good.