**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 <br>
>
> : to accept something that one does not like because there is no choice <br>
>
> _I don't agree with their decision, but all I can do is grin and bear it._
>
> [_Merriam-Webster_](https://www.merriam-webster.com/dictionary/grin%20and%20bear%20it)

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_.