The sentence you provided is in the past tense, and it is grammatically correct. However, there is a minor typo in the word "precedence," which should be spelled as "precedence." Here's the corrected sentence:
"She had to learn that her wishes do not take precedence over other people's needs."