malcontent-control: Ignore a harmless error

This is a backport of
https://github.com/endlessm/gnome-control-center/pull/205 from Endless’
gnome-control-center fork, applied there after the code was copied over
here.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-01-14 14:41:08 +00:00
parent 368cc1fb76
commit e54f7eaf8a
1 changed files with 20 additions and 3 deletions

View File

@ -329,9 +329,26 @@ update_app_filter (MctUserControls *self)
if (error) if (error)
{ {
g_warning ("Error retrieving app filter for user '%s': %s", /* It's expected that a non-admin user can't read another user's parental
act_user_get_user_name (self->user), * controls info unless the panel has been unlocked; ignore such an
error->message); * error.
*/
if (act_user_get_uid (self->user) != getuid () &&
self->permission != NULL &&
!g_permission_get_allowed (self->permission) &&
g_error_matches (error, MCT_APP_FILTER_ERROR, MCT_APP_FILTER_ERROR_PERMISSION_DENIED))
{
g_clear_error (&error);
g_debug ("Not enough permissions to retrieve app filter for user '%s'",
act_user_get_user_name (self->user));
}
else
{
g_warning ("Error retrieving app filter for user '%s': %s",
act_user_get_user_name (self->user),
error->message);
}
return; return;
} }