I am attempting to disable ACL/ACO checks in my local development environment because its time consuming to sync up the ACO table everytime I create a new method or controller. I am having problems figuring out how to do this conditionally. I attempted the following code in AppController but it did not work:
public function beforeFilter() {
parent::beforeFilter();
// disable ACL component in local development environments
if(preg_match('/\.local/',FULL_BASE_URL)){
unset($this->components['Acl']);
unset($this->components['Auth']['authorize']);
}
}
I am running CakePHP 2.x