public static function getCapabilitiesForAction(Table $table, string $contrName, array $actions): array
    {
        $result = [];

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

        $contrName = static::generateCapabilityControllerName($contrName);

        $fullCapabilities = static::generateFullCapabilities($contrName, $actions);
        if (!empty($fullCapabilities)) {
            $result[static::CAP_TYPE_FULL] = $fullCapabilities;
        }

        $ownerCapabilities = static::generateOwnerCapabilities($table, $contrName, $actions);
        if (!empty($ownerCapabilities)) {
            $result[static::CAP_TYPE_OWNER] = $ownerCapabilities;
        }

        $parentCapabilities = static::generateParentCapabilities($table, $contrName, $actions);
        if (!empty($parentCapabilities)) {
            $result[static::CAP_TYPE_PARENT] = $parentCapabilities;
        }

        $belongsToCaps = static::generateBelongsToCapabilities($table, $contrName, $actions);
        if (!empty($belongsToCaps)) {
            $result[static::CAP_TYPE_BELONGS] = $belongsToCaps;
        }

        return $result;
    }