Office politics can have a positive or negative effect on your career; this depends on the way you deal with it. Here are some tips on how to survive office politics and use the power of politics to your advantage.
Understand the people you are working with. Get to know what motivates and inspire them, listen to them. If you understand people, it will be easier for you to deal with them.
Be liked, when you are liked, people are less inclined to battle you when politics starts and it involves you or your work. Do your possible best not to make enemies. If you get along with people, it is easier for people to have confidence in you and support you.
Be diplomatic, know when, where and how to speak. No matter how frustrated or irritated you become keep it professional at all times.
The short answer is that you must be clear about your role and your responsibilities and keep boundaries secure. If you are not clear about any of these, you must clarify them with your line manager or boss. Otherwise, if you are being persuaded to think or act or speak in one direction, which is in opposition to another you could be putting your job in jeopardy.
When you become aware that you are being pulled in one direction, state that your views and opinions are outside the remit of your post; or if they are part of your role, then you will discuss them at the proper time and in the proper place: the meeting room. You can play for time if you are not sure which way you are going to sway by saying that there are strong points on both sides and you have to think it over carefully.
You will give your opinion when the time comes. If you can remain incorruptible you will gain respect, even though you are not pleasing some people in the interim.