From ea04f04f9df2096fccba81a133c711166fe93b28 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:54:11 +0800 Subject: [PATCH] add hide-elevate-button-in-accept-window (#16271) A portable client handed to standard users offers them "Accept and Elevate", which they have no credentials to complete. The builtin option takes that button out of the accept window and leaves elevation to the controlling side's "Request Elevation" during the session. https://github.com/rustdesk/rustdesk-server-pro/discussions/1016 Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab Co-authored-by: Claude Opus 5 --- flutter/lib/consts.dart | 2 ++ flutter/lib/desktop/pages/server_page.dart | 5 ++++- libs/base/src/config/keys.rs | 3 +++ src/ui/cm.tis | 4 +++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 8e05967df..9f7d3dc36 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -126,6 +126,8 @@ const String kOptionEnableBlockInput = "enable-block-input"; const String kOptionEnablePrivacyMode = "enable-privacy-mode"; const String kOptionEnablePermChangeInAcceptWindow = "enable-perm-change-in-accept-window"; +const String kOptionHideElevateButtonInAcceptWindow = + "hide-elevate-button-in-accept-window"; const String kOptionAllowRemoteConfigModification = "allow-remote-config-modification"; const String kOptionVerificationMethod = "verification-method"; diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index b1ca18b2b..eeb51b650 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -1073,7 +1073,10 @@ class _CmControlPanel extends StatelessWidget { final model = Provider.of(context); final showElevation = canElevate && model.showElevation && - client.type_() == ClientType.remote; + client.type_() == ClientType.remote && + bind.mainGetBuildinOption( + key: kOptionHideElevateButtonInAcceptWindow) != + 'Y'; final showAccept = model.approveMode != 'password'; return Column( mainAxisAlignment: MainAxisAlignment.end, diff --git a/libs/base/src/config/keys.rs b/libs/base/src/config/keys.rs index ce38c2c98..bc7426aca 100644 --- a/libs/base/src/config/keys.rs +++ b/libs/base/src/config/keys.rs @@ -48,6 +48,8 @@ pub const OPTION_ENABLE_RECORD_SESSION: &str = "enable-record-session"; pub const OPTION_ENABLE_BLOCK_INPUT: &str = "enable-block-input"; pub const OPTION_ENABLE_PRIVACY_MODE: &str = "enable-privacy-mode"; pub const OPTION_ENABLE_PERM_CHANGE_IN_ACCEPT_WINDOW: &str = "enable-perm-change-in-accept-window"; +pub const OPTION_HIDE_ELEVATE_BUTTON_IN_ACCEPT_WINDOW: &str = + "hide-elevate-button-in-accept-window"; pub const OPTION_ALLOW_SCOPE_VIOLATION_CLOSE: &str = "allow-scope-violation-close"; pub const OPTION_ALLOW_SCOPE_VIOLATION_ALARM: &str = "allow-scope-violation-alarm"; pub const OPTION_ALLOW_REMOTE_CONFIG_MODIFICATION: &str = "allow-remote-config-modification"; @@ -366,6 +368,7 @@ pub const KEYS_BUILDIN_SETTINGS: &[&str] = &[ OPTION_DISABLE_UNLOCK_PIN, OPTION_USE_RAW_TCP_FOR_API, OPTION_ENABLE_PERM_CHANGE_IN_ACCEPT_WINDOW, + OPTION_HIDE_ELEVATE_BUTTON_IN_ACCEPT_WINDOW, OPTION_ALLOW_COMMAND_LINE_SETTINGS_WHEN_SETTINGS_DISABLED, ]; diff --git a/src/ui/cm.tis b/src/ui/cm.tis index f306e9032..a5d79ae3e 100644 --- a/src/ui/cm.tis +++ b/src/ui/cm.tis @@ -7,6 +7,8 @@ var show_elevation = true; var is_privacy_mode_supported = handler.get_supported_privacy_mode_impls() != '[]'; var allow_perm_change_in_accept_window = handler.get_builtin_option('enable-perm-change-in-accept-window') != 'N'; +var hide_elevate_button_in_accept_window = + handler.get_builtin_option('hide-elevate-button-in-accept-window') == 'Y'; var svg_elevate = ; var hide_cm = undefined; @@ -80,7 +82,7 @@ class Body: Reactor.Component {c.port_forward ?
Port Forwarding: {c.port_forward}
: ""}
- {!auth && !disconnected && show_elevation_btn && show_accept_btn ? : "" } + {!auth && !disconnected && show_elevation_btn && show_accept_btn && !hide_elevate_button_in_accept_window ? : "" } {auth && !disconnected && show_elevation_btn ? : "" }
{!auth && show_accept_btn ? : "" }