Grin and bear it is an idiom that can be used, especially in your boss example where you have to put up with a boss you hate in a workplace because you have to.
grin and bear it idiom
: to accept something that one does not like because there is no choice
I don't agree with their decision, but all I can do is grin and bear it.
If you want a more general idiom, there is put up with someone/something which I've mentioned in the explanation above. However, it doesn't include the sense that there is no choice like grin and bear it.