As far as i remember, when you flash it with TWRP (custom recovery), after the flash is completed, before you restart the phone, it will ask you if you want to root it (it is your choice).
I have the latest stable rom, and i don't have a problem yet.
Hope it will help you!