Acl\AclExtras::_checkMethods PHP Method

_checkMethods() protected method

Check and Add/delete controller Methods
protected _checkMethods ( string $className, string $controllerName, array $node, string $pluginPath = null, string $prefixPath = null ) : boolean
$className string The classname to check
$controllerName string The controller name
$node array The node to check.
$pluginPath string The plugin path to use.
$prefixPath string The prefix path to use.
return boolean
    protected function _checkMethods($className, $controllerName, $node, $pluginPath = null, $prefixPath = null)
    {
        $excludes = $this->_getCallbacks($className, $pluginPath, $prefixPath);
        $baseMethods = get_class_methods(new Controller());
        $namespace = $this->_getNamespace($className, $pluginPath, $prefixPath);
        $methods = get_class_methods(new $namespace());
        if ($methods == null) {
            $this->err(__d('cake_acl', 'Unable to get methods for {0}', $className));
            return false;
        }
        $actions = array_diff($methods, $baseMethods);
        $actions = array_diff($actions, $excludes);
        foreach ($actions as $key => $action) {
            if (strpos($action, '_', 0) === 0) {
                continue;
            }
            $path = [$this->rootNode, $pluginPath, $prefixPath, $controllerName, $action];
            $path = implode('/', Hash::filter($path));
            $this->_checkNode($path, $action, $node->id);
            $actions[$key] = $action;
        }
        if ($this->_clean) {
            $this->_cleaner($node->id, $actions);
        }
        return true;
    }