fix mdm allowserverssh

This commit is contained in:
Eduard Gert
2026-06-15 13:20:16 +02:00
parent b6246e7c02
commit 90be56788a
3 changed files with 21 additions and 15 deletions

View File

@@ -19,6 +19,7 @@ export const SettingsNavigation = () => {
const { t } = useTranslation();
const { updateAvailable } = useClientVersion();
const { mdm, features } = useRestrictions();
const showSsh = mdm.allowServerSSH || !features.disableUpdateSettings;
const aboutAdornment = updateAvailable ? (
<Tooltip content={t("settings.tabs.updateAvailable")} side={"right"}>
@@ -55,21 +56,19 @@ export const SettingsNavigation = () => {
title={t("settings.tabs.profiles")}
/>
)}
{showSsh && (
<VerticalTabs.Trigger
value={"ssh"}
icon={SquareTerminalIcon}
title={t("settings.tabs.ssh")}
/>
)}
{!features.disableUpdateSettings && (
<>
{!mdm.allowServerSSH && (
<VerticalTabs.Trigger
value={"ssh"}
icon={SquareTerminalIcon}
title={t("settings.tabs.ssh")}
/>
)}
<VerticalTabs.Trigger
value={"advanced"}
icon={BoltIcon}
title={t("settings.tabs.advanced")}
/>
</>
<VerticalTabs.Trigger
value={"advanced"}
icon={BoltIcon}
title={t("settings.tabs.advanced")}
/>
)}
<VerticalTabs.Trigger
value={"troubleshooting"}

View File

@@ -54,7 +54,7 @@ export const SettingsPage = () => {
[Tab.Network]: editable,
[Tab.Security]: editable,
[Tab.Profiles]: !features.disableProfiles,
[Tab.SSH]: editable && !mdm.allowServerSSH,
[Tab.SSH]: mdm.allowServerSSH || editable,
[Tab.Advanced]: editable,
[Tab.Troubleshooting]: true,
[Tab.About]: true,

View File

@@ -235,6 +235,10 @@ func (s *Settings) GetRestrictions(ctx context.Context) (Restrictions, error) {
if v.Field(i).Kind() != reflect.Bool {
continue
}
// AllowServerSSH carries the resolved value (like ManagementURL), not the is-managed flag.
if t.Field(i).Name == "AllowServerSSH" {
continue
}
if _, ok := set[t.Field(i).Tag.Get("json")]; ok {
v.Field(i).SetBool(true)
}
@@ -242,6 +246,9 @@ func (s *Settings) GetRestrictions(ctx context.Context) (Restrictions, error) {
if _, ok := set["managementURL"]; ok {
r.MDM.ManagementURL = cfgResp.GetManagementUrl()
}
if _, ok := set["allowServerSSH"]; ok {
r.MDM.AllowServerSSH = cfgResp.GetServerSSHAllowed()
}
}
r.MDM.DisableAdvancedView = featResp.GetDisableAdvancedView()
return r, nil