[gnome-software/gnome-42: 6/7] gs-safety-context-dialog: Indicate when the GS_APP_PERMISSIONS_FILESYSTEM_OTHER is set




commit dd66d84e757f3012c2f9711b22b44a2fc305a13f
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 13 17:03:38 2022 +0200

    gs-safety-context-dialog: Indicate when the GS_APP_PERMISSIONS_FILESYSTEM_OTHER is set
    
    There's a difference between no filesystem permissions and permissions
    the gnome-software does not know about, thus rather show a warning
    than claim no filesystem permission is requested by the app.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1701

 src/gs-safety-context-dialog.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/src/gs-safety-context-dialog.c b/src/gs-safety-context-dialog.c
index 3b82b626a..1cb955f1c 100644
--- a/src/gs-safety-context-dialog.c
+++ b/src/gs-safety-context-dialog.c
@@ -279,10 +279,23 @@ update_permissions_list (GsSafetyContextDialog *self)
                                    _("Download Folder Read Access"),
                                    _("Can read all data in your downloads directory"),
                                    NULL, NULL, NULL);
+               add_permission_row (self->permissions_list, &chosen_rating,
+                                   ((permissions & GS_APP_PERMISSIONS_FILESYSTEM_OTHER) != 0 &&
+                                    !(permissions & (GS_APP_PERMISSIONS_FILESYSTEM_FULL |
+                                                     GS_APP_PERMISSIONS_FILESYSTEM_READ |
+                                                     GS_APP_PERMISSIONS_HOME_FULL |
+                                                     GS_APP_PERMISSIONS_HOME_READ))),
+                                   GS_CONTEXT_DIALOG_ROW_IMPORTANCE_WARNING,
+                                   "folder-documents-symbolic",
+                                   /* Translators: This refers to permissions (for example, from flatpak) 
which an app requests from the user. */
+                                   _("Access arbitrary files"),
+                                   _("Can access arbitrary files on the file system"),
+                                   NULL, NULL, NULL);
 
                add_permission_row (self->permissions_list, &chosen_rating,
                                    !(permissions & (GS_APP_PERMISSIONS_FILESYSTEM_FULL |
                                                     GS_APP_PERMISSIONS_FILESYSTEM_READ |
+                                                    GS_APP_PERMISSIONS_FILESYSTEM_OTHER |
                                                     GS_APP_PERMISSIONS_HOME_FULL |
                                                     GS_APP_PERMISSIONS_HOME_READ |
                                                     GS_APP_PERMISSIONS_DOWNLOADS_FULL |


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