Was working on a wordpress site when i found that the theme editor under appearance was missing. Started to google it and some common reasons was because:
role editor plugin
wp-security plugin have it disabled with an option to turn on.
but for my site it was because it was disabled by hard code in the wp-config.php file
define(‘DISALLOW_FILE_EDIT’, TRUE); //Disable File Editing
This is a good security practice. so turn it off if you dont need it.