summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2021-06-09 22:45:42 +0200
committerAndrew Zaborowski <balrogg@gmail.com>2021-06-22 21:07:52 +0200
commita0f95d83ff946ba854143414c97c4ed7af19b7fa (patch)
tree8e14de54410b2064393b78718cfdc5dfa0f219bd
parent7f3f7f7a0a213dc09f2c0964968d781eda4568a0 (diff)
downloadnetwork-manager-applet-a0f95d83ff946ba854143414c97c4ed7af19b7fa.tar.gz
applet: If permitted, create system Wi-Fi connections
Wi-Fi connections were being always created with the default of connection.permissions=user:<current_user>. Now create them with empty permissions ("All users may connect to this network") if the user is authorized to create/modify system connections, similar to the logic in other clients.
-rw-r--r--src/applet-device-wifi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index b39d2f0f..8419bc43 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -462,11 +462,15 @@ wifi_new_auto_connection (NMDevice *device,
connection = nm_simple_connection_new ();
- /* Make the new connection available only for the current user */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
- nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL);
nm_connection_add_setting (connection, NM_SETTING (s_con));
+ if (applet->permissions[NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM]
+ != NM_CLIENT_PERMISSION_RESULT_YES) {
+ /* Make the new connection available only for the current user */
+ nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL);
+ }
+
ssid = nm_access_point_get_ssid (ap);
if ( (nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA)
&& (is_manufacturer_default_ssid (ssid) == TRUE)) {