CakeDC\Users\Auth\SimpleRbacAuthorize::_loadPermissions PHP Method

_loadPermissions() protected method

Load config and retrieve permissions If the configuration file does not exist, or the permissions key not present, return defaultPermissions To be mocked
protected _loadPermissions ( string $key ) : array
$key string name of the configuration file to read permissions from
return array permissions
    protected function _loadPermissions($key)
    {
        try {
            Configure::load($key, 'default');
            $permissions = Configure::read('Users.SimpleRbac.permissions');
        } catch (Exception $ex) {
            $msg = __d('CakeDC/Users', 'Missing configuration file: "config/{0}.php". Using default permissions', $key);
            $this->log($msg, LogLevel::WARNING);
        }
        if (empty($permissions)) {
            return $this->_defaultPermissions;
        }
        return $permissions;
    }