Because he inherited the Imam 's political powers but little of the religious authority , Khamenei tried to compensate by forging alliances with the security establishment , particularly among the commanders of the Revolutionary Guard and the basij militia .