Definition 1 of 1
It could be a boss, a parent, a professor, or an influential friend who does it. But the expression shines its best when the taker of the class exhibits such taking of the class to others than involved parties, to bring about the final coup de grace by saying loudly for everyone to hear,"I took a class ON him/her"
The origin of the expression seems to be from the horrific nature of the classes that many students are fated to endure at the hands of their teachers, the class itself being a punishing experience much more than the learning experience it aught to be.
( properly, I took a class ).
You could often actually twist the roles if you are in a position to, by claiming that you 'took a class' on someone else while actually it was you who faced the music, especially this twisting could happen between friends and equals at work