I have depleted my resources trying to figure this out. How do I only enable the "greatly helpful" DebugKit
to only load when the logged in user is an administrator? The approach I know and thought to work, is with Configure::write('debug', 1)
, but it has not worked. I am not sure what else I can do... This is the code I current have in the `AppController.php1 file
// AppController.php
public function beforeFilter(Event $event){
parent::beforeFilter($event);
// ...
// Checks if loggedin user is an administrator
if($this->Auth->user() && $this->Auth->user('role' == 'admin')){
// Enable debugging and allow DebugKit to load
Configure::write('debug', 1);
}
}