src/Auth/AclTrait.php
protected function _getAcl($path = null) {
		if ($this->getConfig('autoClearCache') && Configure::read('debug')) {
			Cache::delete($this->getConfig('aclCacheKey'), $this->getConfig('cache'));
		}
		$roles = Cache::read($this->getConfig('aclCacheKey'), $this->getConfig('cache'));
		if ($roles !== false) {
			return $roles;
		}

		if ($path === null) {
			$path = $this->getConfig('aclFilePath');
		}
		$config = $this->getConfig();
		$config['filePath'] = $path;
		$config['file'] = $config['aclFile'];
		unset($config['aclFilePath']);
		unset($config['aclFile']);

		$roles = $this->_aclAdapter->getAcl($this->_getAvailableRoles(), $config);
		Cache::write($this->getConfig('aclCacheKey'), $roles, $this->getConfig('cache'));

		return $roles;
	}
protected function _getAcl($path = null) {
		if ($this->getConfig('autoClearCache') && Configure::read('debug')) {
			Cache::delete($this->getConfig('aclCacheKey'), $this->getConfig('cache'));
		}
		$roles = Cache::read($this->getConfig('aclCacheKey'), $this->getConfig('cache'));
		if ($roles !== false) {
			return $roles;
		}

		if ($path === null) {
			$path = $this->getConfig('aclFilePath');
		}
		$config = $this->getConfig();
		$config['filePath'] = $path;
		$config['file'] = $config['aclFile'];
		unset($config['aclFilePath']);
		unset($config['aclFile']);

		$roles = $this->_aclAdapter->getAcl($this->_getAvailableRoles(), $config);
		Cache::write($this->getConfig('aclCacheKey'), $roles, $this->getConfig('cache'));

		return $roles;
	}
protected function _getAcl ( $ path = null ) { if ( $ this -> getConfig ( 'autoClearCache' ) && Configure :: read ( 'debug' ) ) { Cache :: delete ( $ this -> getConfig ( 'aclCacheKey' ) , $ this -> getConfig ( 'cache' ) ) ; } $ roles = Cache :: read ( $ this -> getConfig ( 'aclCacheKey' ) , $ this -> getConfig ( 'cache' ) ) ; if ( $ roles !== false ) { return $ roles ; } if ( $ path === null ) { $ path = $ this -> getConfig ( 'aclFilePath' ) ; } $ config = $ this -> getConfig ( ) ; $ config [ 'filePath' ] = $ path ; $ config [ 'file' ] = $ config [ 'aclFile' ] ; unset ( $ config [ 'aclFilePath' ] ) ; unset ( $ config [ 'aclFile' ] ) ; $ roles = $ this -> _aclAdapter -> getAcl ( $ this -> _getAvailableRoles ( ) , $ config ) ; Cache :: write ( $ this -> getConfig ( 'aclCacheKey' ) , $ roles , $ this -> getConfig ( 'cache' ) ) ; return $ roles ; }
Parses INI file and returns the allowed roles per action.

Uses cache for maximum performance.
Improved speed by several actions before caching:
- Resolves role slugs to their primary key / identifier
- Resolves wildcards to their verbose translation

@param string|array|null $path
@return array Roles
Parses INI file and returns the allowed roles per action .