public static function getCapabilities(string $controllerName = null, array $actions = []): array
    {
        $result = [];

        if (empty($controllerName)) {
            return $result;
        }

        $skipControllers = Configure::read('RolesCapabilities.accessCheck.skipControllers');
        if (is_callable([$controllerName, 'getSkipControllers'])) {
            $skipControllers = array_merge($skipControllers, $controllerName::getSkipControllers());
        }

        if (in_array($controllerName, $skipControllers)) {
            return $result;
        }

        $actions = static::getActions($controllerName, $actions);

        if (empty($actions)) {
            return $result;
        }

        // get controller table instance
        $table = static::getControllerTableInstance($controllerName);

        $result = static::getCapabilitiesForAction($table, $controllerName, $actions);

        return $result;
    }