1
Index: b/src/applet-device-wifi.c
2
===================================================================
3
--- a/src/applet-device-wifi.c
4
+++ b/src/applet-device-wifi.c
5
@@ -758,6 +758,8 @@ create_new_ap_item (NMDeviceWifi *device
6
GSList *ap_connections = NULL;
7
const GByteArray *ssid;
9
+ gboolean config_allowed;
10
+ NMClientPermissionResult perm;
12
dev_connections = nm_device_filter_connections (NM_DEVICE (device), connections);
13
ap_connections = nm_access_point_filter_connections (ap, dev_connections);
14
@@ -810,6 +812,31 @@ create_new_ap_item (NMDeviceWifi *device
15
ap_menu_item_set_sensitive (item, ap, dev_caps);
16
#endif /* ENABLE_INDICATOR */
18
+ config_allowed = FALSE;
19
+ perm = nm_client_get_permission_result (applet->nm_client,
20
+ NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN);
21
+ if ( perm == NM_CLIENT_PERMISSION_RESULT_YES
22
+ || perm == NM_CLIENT_PERMISSION_RESULT_AUTH) {
23
+ /* The user can modify (and add!) a new configuration for herself. */
24
+ config_allowed = TRUE;
26
+ perm = nm_client_get_permission_result (applet->nm_client,
27
+ NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM);
28
+ if ( perm == NM_CLIENT_PERMISSION_RESULT_YES
29
+ || perm == NM_CLIENT_PERMISSION_RESULT_AUTH) {
30
+ /* The user can modify (and add!) a new system wide configuration. */
31
+ config_allowed = TRUE;
34
+ if ( applet->greeter_mode
35
+ && g_slist_length (ap_connections) == 0
36
+ && !config_allowed) {
37
+ /* Make the access points which user can't connect
38
+ * inside the greeter insensitive
40
+ gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
43
g_object_set_data (G_OBJECT (item), "device", NM_DEVICE (device));
45
/* If there's only one connection, don't show the submenu */