public function can_cancel_plugin_installation(\core\plugininfo\base $plugin) {
        global $CFG;

        if (!empty($CFG->disableupdateautodeploy)) {
            return false;
        }

        if (empty($plugin) or $plugin->is_standard() or $plugin->is_subplugin()
                or !$this->is_plugin_folder_removable($plugin->component)) {
            return false;
        }

        if ($plugin->get_status() === self::PLUGIN_STATUS_NEW) {
            return true;
        }

        return false;
    }