mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Autoupdate option visible only for administrators group (#2945)
* Added isAdmin value to Settings.UI. Changed elevation check to user group check for AutoDownload toggle
This commit is contained in:
committed by
GitHub
parent
3dc61962de
commit
a13c8cb71e
@@ -8,10 +8,10 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Utilities;
|
||||
using Microsoft.PowerToys.Settings.UI.ViewModels.Commands;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Utilities;
|
||||
using Windows.Data.Html;
|
||||
using Windows.System;
|
||||
using Windows.UI.Popups;
|
||||
@@ -97,12 +97,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_autoDownloadUpdates = GeneralSettingsConfigs.AutoDownloadUpdates;
|
||||
_isElevated = ShellPage.IsElevated;
|
||||
_runElevated = GeneralSettingsConfigs.RunElevated;
|
||||
_isAdmin = ShellPage.IsUserAnAdmin;
|
||||
}
|
||||
|
||||
private bool _packaged = false;
|
||||
private bool _startup = false;
|
||||
private bool _isElevated = false;
|
||||
private bool _runElevated = false;
|
||||
private bool _isAdmin = false;
|
||||
private bool _isDarkThemeRadioButtonChecked = false;
|
||||
private bool _isLightThemeRadioButtonChecked = false;
|
||||
private bool _isSystemThemeRadioButtonChecked = false;
|
||||
@@ -218,6 +220,15 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
// Gets a value indicating whether the user is part of administrators group.
|
||||
public bool IsAdmin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isAdmin;
|
||||
}
|
||||
}
|
||||
|
||||
public bool AutoDownloadUpdates
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user