[gnome-shell/wip/rstrode/make-lock-down-keys-rule] unlockDialog: Honor switch user lockdown settings




commit 118d55699176b5a34b04d4bc4f7ab371fa4661dd
Author: Ray Strode <rstrode redhat com>
Date:   Thu May 6 09:32:48 2021 -0400

    unlockDialog: Honor switch user lockdown settings
    
    At the moment user switching functionality is controlled by two
    settings:
    
    org.gnome.desktop.lockdown disable-user-switching
    
    for the panel when the session is unlocked, and
    
    org.gnome.desktop.screensaver user-switch-enabled
    
    for the unlock dialog when the session is locked.
    
    Having the lockdown setting not apply when the screen is
    locked is counterintuitive.
    
    This commit makes the unlock dialog honor both settings.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1833>

 js/ui/unlockDialog.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 239e75ef5b..370385abc4 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -577,6 +577,10 @@ var UnlockDialog = GObject.registerClass({
         this._userSwitchEnabledId = this._screenSaverSettings.connect('changed::user-switch-enabled',
             this._updateUserSwitchVisibility.bind(this));
 
+        this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+        this._lockdownSettings.connect('changed::disable-user-switching',
+            this._updateUserSwitchVisibility.bind(this));
+
         this._userLoadedId = this._user.connect('notify::is-loaded',
             this._updateUserSwitchVisibility.bind(this));
 
@@ -858,7 +862,8 @@ var UnlockDialog = GObject.registerClass({
 
     _updateUserSwitchVisibility() {
         this._otherUserButton.visible = this._userManager.can_switch() &&
-            this._screenSaverSettings.get_boolean('user-switch-enabled');
+            this._screenSaverSettings.get_boolean('user-switch-enabled') &&
+            !this._lockdownSettings.get_boolean('disable-user-switching');
     }
 
     cancel() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]