Also reformatted the code and minor bug fixed it
Remove redundant setting retrival code. An example config.php entry to activate the new config: $config['site']['sensitivecontent']['hideforvisitors'] = true;