ABOVE ALL ELSE, GUARD YOU HEARTS, FOR IT AFFECTS EVERYTHING YOU DO.
The purpose of a guardrail on a dangerous curve is not to inhibit your freedom to drive but to save your life! in the same way, God has giving you a guardrail for traveling through life, not to inhibit your freedom but to keep your life from going out of control. Your heart determines where you go because it affects your passions and emotions. If you don't guard your heart with the boundaries given in the Bible and stay focus on the road God wants you to take, you might have a terrible accident when temptations and sin distract you.
When you are an a situation that might hider your morals and integrity ask God for strength to walk away from that situation.
Ultimately is going to be your decision and that! will depend of how strong your walk with the Lord is.