Rapper Megan Thee Stallion has been granted a restraining order from imprisoned rapper Tory Lanez until early 2030.