Commit bd4eef66 authored by Robert Ancell's avatar Robert Ancell

Add a basic permissions system

parent a6cc13d8
......@@ -92,6 +92,7 @@ typedef struct
gchar *origin;
gchar *origin_appstream;
gchar *origin_hostname;
GPtrArray *permissions;
gchar *update_version;
gchar *update_version_ui;
gchar *update_details;
......@@ -448,6 +449,18 @@ gs_app_to_string_append (GsApp *app, GString *str)
gs_app_kv_lpad (str, "icon-filename",
as_icon_get_filename (icon));
}
for (i = 0; i < priv->permissions->len; i++) {
GsPermission *permission;
GsPermissionValue *value;
g_autofree gchar *key = NULL;
permission = g_ptr_array_index (priv->permissions, i);
value = gs_permission_get_value (permission);
key = g_strdup_printf ("permission-%02u", i);
gs_app_kv_printf (str, key, "[%s] %s",
gs_permission_get_label (permission),
value ? gs_permission_value_get_label (value) : "(unset)");
}
if (priv->match_value != 0)
gs_app_kv_printf (str, "match-value", "%05x", priv->match_value);
if (priv->priority != 0)
......@@ -2599,6 +2612,46 @@ gs_app_set_origin_hostname (GsApp *app, const gchar *origin_hostname)
priv->origin_hostname = g_strdup (origin_hostname);
}
/**
* gs_app_add_permission:
* @app: a #GsApp
* @permission: a #GsPermission
*
* Adds a permission to the applicaton.
*
* Since: 3.26
**/
void
gs_app_add_permission (GsApp *app, GsPermission *permission)
{
GsAppPrivate *priv = gs_app_get_instance_private (app);
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_PERMISSION (permission));
g_ptr_array_add (priv->permissions, g_object_ref (permission));
}
/**
* gs_app_get_permissions:
* @app: a #GsApp
*
* Gets the list of permissions.
*
* Returns: (element-type GsPermission) (transfer none): a list
*
* Since: 3.26
**/
GPtrArray *
gs_app_get_permissions (GsApp *app)
{
GsAppPrivate *priv = gs_app_get_instance_private (app);
g_return_val_if_fail (GS_IS_APP (app), NULL);
return priv->permissions;
}
/**
* gs_app_add_screenshot:
* @app: a #GsApp
......@@ -4256,6 +4309,7 @@ gs_app_dispose (GObject *object)
g_clear_pointer (&priv->icons, g_ptr_array_unref);
g_clear_pointer (&priv->channels, g_ptr_array_unref);
g_clear_object (&priv->active_channel);
g_clear_pointer (&priv->permissions, g_ptr_array_unref);
G_OBJECT_CLASS (gs_app_parent_class)->dispose (object);
}
......@@ -4444,6 +4498,7 @@ gs_app_init (GsApp *app)
priv->provides = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
priv->icons = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
priv->channels = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
priv->permissions = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
priv->metadata = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
......
......@@ -30,6 +30,7 @@
#include "gs-channel.h"
#include "gs-price.h"
#include "gs-permission.h"
G_BEGIN_DECLS
......@@ -212,6 +213,9 @@ void gs_app_set_origin_appstream (GsApp *app,
const gchar *gs_app_get_origin_hostname (GsApp *app);
void gs_app_set_origin_hostname (GsApp *app,
const gchar *origin_hostname);
GPtrArray *gs_app_get_permissions (GsApp *app);
void gs_app_add_permission (GsApp *app,
GsPermission *permission);
GPtrArray *gs_app_get_screenshots (GsApp *app);
void gs_app_add_screenshot (GsApp *app,
AsScreenshot *screenshot);
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2017 Canonical Ltd.
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib/gi18n.h>
#include "gs-permission-value.h"
struct _GsPermissionValue
{
GObject parent_instance;
gchar *label;
GHashTable *metadata; /* utf8: utf8 */
};
G_DEFINE_TYPE (GsPermissionValue, gs_permission_value, G_TYPE_OBJECT)
/**
* gs_permission_value_get_metadata_item:
* @value: a #GsPermissionValue
* @key: a string
*
* Gets some metadata from a permission value object.
* It is left for the the plugin to use this method as required, but a
* typical use would be to retrieve an ID for this permission value.
*
* Returns: A string value, or %NULL for not found
*/
const gchar *
gs_permission_value_get_metadata_item (GsPermissionValue *value, const gchar *key)
{
g_return_val_if_fail (GS_IS_PERMISSION_VALUE (value), NULL);
g_return_val_if_fail (key != NULL, NULL);
return g_hash_table_lookup (value->metadata, key);
}
/**
* gs_permission_value_add_metadata:
* @value: a #GsPermissionValue
* @key: a string
* @value: a string
*
* Adds metadata to the permission object.
* It is left for the the plugin to use this method as required, but a
* typical use would be to store an ID for this permission.
*/
void
gs_permission_value_add_metadata (GsPermissionValue *value, const gchar *key, const gchar *val)
{
g_return_if_fail (GS_IS_PERMISSION_VALUE (value));
g_hash_table_insert (value->metadata, g_strdup (key), g_strdup (val));
}
/**
* gs_permission_value_get_label:
* @permission: a #GsPermissionValue
*
* Get the label for this permission.
*
* Returns: a label string.
*/
const gchar *
gs_permission_value_get_label (GsPermissionValue *value)
{
g_return_val_if_fail (GS_IS_PERMISSION_VALUE (value), NULL);
return value->label;
}
static void
gs_permission_value_finalize (GObject *object)
{
GsPermissionValue *value = GS_PERMISSION_VALUE (object);
g_free (value->label);
g_hash_table_unref (value->metadata);
G_OBJECT_CLASS (gs_permission_value_parent_class)->finalize (object);
}
static void
gs_permission_value_class_init (GsPermissionValueClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gs_permission_value_finalize;
}
static void
gs_permission_value_init (GsPermissionValue *value)
{
value->metadata = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
}
GsPermissionValue *
gs_permission_value_new (const gchar *label)
{
GsPermissionValue *value;
value = g_object_new (GS_TYPE_PERMISSION_VALUE, NULL);
value->label = g_strdup (label);
return GS_PERMISSION_VALUE (value);
}
/* vim: set noexpandtab: */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2017 Canonical Ltd.
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __GS_PERMISSION_VALUE_H
#define __GS_PERMISSION_VALUE_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GS_TYPE_PERMISSION_VALUE (gs_permission_value_get_type ())
G_DECLARE_FINAL_TYPE (GsPermissionValue, gs_permission_value, GS, PERMISSION_VALUE, GObject)
GsPermissionValue *gs_permission_value_new (const gchar *label);
const gchar *gs_permission_value_get_metadata_item (GsPermissionValue *value,
const gchar *key);
void gs_permission_value_add_metadata (GsPermissionValue *value,
const gchar *key,
const gchar *val);
const gchar *gs_permission_value_get_label (GsPermissionValue *value);
G_END_DECLS
#endif /* __GS_PERMISSION_VALUE_H */
/* vim: set noexpandtab: */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2017 Canonical Ltd.
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib/gi18n.h>
#include "gs-permission.h"
struct _GsPermission
{
GObject parent_instance;
gchar *label;
GPtrArray *values;
GsPermissionValue *value;
GHashTable *metadata; /* utf8: utf8 */
};
G_DEFINE_TYPE (GsPermission, gs_permission, G_TYPE_OBJECT)
/**
* gs_permission_get_metadata_item:
* @permission: a #GsPermission
* @key: a string
*
* Gets some metadata from a permission object.
* It is left for the the plugin to use this method as required, but a
* typical use would be to retrieve an ID for this permission.
*
* Returns: A string value, or %NULL for not found
*/
const gchar *
gs_permission_get_metadata_item (GsPermission *permission, const gchar *key)
{
g_return_val_if_fail (GS_IS_PERMISSION (permission), NULL);
g_return_val_if_fail (key != NULL, NULL);
return g_hash_table_lookup (permission->metadata, key);
}
/**
* gs_permission_add_metadata:
* @permission: a #GsPermission
* @key: a string
* @value: a string
*
* Adds metadata to the permission object.
* It is left for the the plugin to use this method as required, but a
* typical use would be to store an ID for this permission.
*/
void
gs_permission_add_metadata (GsPermission *permission, const gchar *key, const gchar *value)
{
g_return_if_fail (GS_IS_PERMISSION (permission));
g_hash_table_insert (permission->metadata, g_strdup (key), g_strdup (value));
}
/**
* gs_permission_get_label:
* @permission: a #GsPermission
*
* Get the label for this permission.
*
* Returns: a label string.
*/
const gchar *
gs_permission_get_label (GsPermission *permission)
{
g_return_val_if_fail (GS_IS_PERMISSION (permission), NULL);
return permission->label;
}
/**
* gs_permission_add_value:
* @permission: a #GsPermission
* @value: a #GsPermissionValue
*
* Add a possible values for this permission.
*/
void
gs_permission_add_value (GsPermission *permission, GsPermissionValue *value)
{
g_return_if_fail (GS_IS_PERMISSION (permission));
g_ptr_array_add (permission->values, g_object_ref (value));
}
/**
* gs_permission_get_values:
* @permission: a #GsPermission
*
* Get the possible values for this permission.
*
* Returns: (element-type GsPermissionValue) (transfer none): a list
*/
GPtrArray *
gs_permission_get_values (GsPermission *permission)
{
g_return_val_if_fail (GS_IS_PERMISSION (permission), NULL);
return permission->values;
}
/**
* gs_permission_get_value:
* @permission: a #GsPermission
*
* Get the value for this permission.
*
* Returns: a %GsPermissionValue or %NULL.
*/
GsPermissionValue *
gs_permission_get_value (GsPermission *permission)
{
g_return_val_if_fail (GS_IS_PERMISSION (permission), NULL);
return permission->value;
}
/**
* gs_permission_set_value:
* @permission: a #GsPermission
* @value: a #GsPermissionValue to set for this permission
*
* Set the value of this permission.
*/
void
gs_permission_set_value (GsPermission *permission, GsPermissionValue *value)
{
g_return_if_fail (GS_IS_PERMISSION (permission));
g_set_object (&permission->value, value);
}
static void
gs_permission_dispose (GObject *object)
{
GsPermission *permission = GS_PERMISSION (object);
g_clear_pointer (&permission->values, g_ptr_array_unref);
g_clear_object (&permission->value);
G_OBJECT_CLASS (gs_permission_parent_class)->dispose (object);
}
static void
gs_permission_finalize (GObject *object)
{
GsPermission *permission = GS_PERMISSION (object);
g_free (permission->label);
g_hash_table_unref (permission->metadata);
G_OBJECT_CLASS (gs_permission_parent_class)->finalize (object);
}
static void
gs_permission_class_init (GsPermissionClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gs_permission_dispose;
object_class->finalize = gs_permission_finalize;
}
static void
gs_permission_init (GsPermission *permission)
{
permission->metadata = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
permission->values = g_ptr_array_new_with_free_func (g_object_unref);
}
GsPermission *
gs_permission_new (const gchar *label)
{
GsPermission *permission;
permission = g_object_new (GS_TYPE_PERMISSION, NULL);
permission->label = g_strdup (label);
return GS_PERMISSION (permission);
}
/* vim: set noexpandtab: */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2017 Canonical Ltd.
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __GS_PERMISSION_H
#define __GS_PERMISSION_H
#include <glib-object.h>
#include "gs-permission-value.h"
G_BEGIN_DECLS
#define GS_TYPE_PERMISSION (gs_permission_get_type ())
G_DECLARE_FINAL_TYPE (GsPermission, gs_permission, GS, PERMISSION, GObject)
GsPermission *gs_permission_new (const gchar *label);
const gchar *gs_permission_get_metadata_item (GsPermission *permission,
const gchar *key);
void gs_permission_add_metadata (GsPermission *permission,
const gchar *key,
const gchar *value);
const gchar *gs_permission_get_label (GsPermission *permission);
void gs_permission_add_value (GsPermission *permission,
GsPermissionValue *value);
GPtrArray *gs_permission_get_values (GsPermission *permission);
GsPermissionValue *gs_permission_get_value (GsPermission *permission);
void gs_permission_set_value (GsPermission *permission,
GsPermissionValue *value);
G_END_DECLS
#endif /* __GS_PERMISSION_H */
/* vim: set noexpandtab: */
......@@ -53,6 +53,8 @@ GsCategory *gs_plugin_job_get_category (GsPluginJob *self);
AsReview *gs_plugin_job_get_review (GsPluginJob *self);
GsPrice *gs_plugin_job_get_price (GsPluginJob *self);
GsChannel *gs_plugin_job_get_channel (GsPluginJob *self);
GsPermission *gs_plugin_job_get_permission (GsPluginJob *self);
GsPermissionValue *gs_plugin_job_get_permission_value (GsPluginJob *self);
gchar *gs_plugin_job_to_string (GsPluginJob *self);
void gs_plugin_job_set_action (GsPluginJob *self,
GsPluginAction action);
......
......@@ -49,6 +49,8 @@ struct _GsPluginJob
AsReview *review;
GsPrice *price;
GsChannel *channel;
GsPermission *permission;
GsPermissionValue *permission_value;
gint64 time_created;
};
......@@ -70,6 +72,8 @@ enum {
PROP_PRICE,
PROP_CHANNEL,
PROP_TIMEOUT,
PROP_PERMISSION,
PROP_PERMISSION_VALUE,
PROP_LAST
};
......@@ -138,6 +142,12 @@ gs_plugin_job_to_string (GsPluginJob *self)
g_autofree gchar *path = g_file_get_path (self->file);
g_string_append_printf (str, " with file=%s", path);
}
if (self->permission != NULL) {
g_string_append_printf (str, " with permission=%s", gs_permission_get_label (self->permission));
}
if (self->permission_value != NULL) {
g_string_append_printf (str, " with permission-value=%s", gs_permission_value_get_label (self->permission_value));
}
if (self->plugin != NULL) {
g_string_append_printf (str, " on plugin=%s",
gs_plugin_get_name (self->plugin));
......@@ -454,6 +464,34 @@ gs_plugin_job_get_channel (GsPluginJob *self)
return self->channel;
}
void
gs_plugin_job_set_permission (GsPluginJob *self, GsPermission *permission)
{
g_return_if_fail (GS_IS_PLUGIN_JOB (self));
g_set_object (&self->permission, permission);
}
GsPermission *
gs_plugin_job_get_permission (GsPluginJob *self)
{
g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), NULL);
return self->permission;
}
void
gs_plugin_job_set_permission_value (GsPluginJob *self, GsPermissionValue *value)
{
g_return_if_fail (GS_IS_PLUGIN_JOB (self));
g_set_object (&self->permission_value, value);
}
GsPermissionValue *
gs_plugin_job_get_permission_value (GsPluginJob *self)
{
g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), NULL);
return self->permission_value;
}
static void
gs_plugin_job_get_property (GObject *obj, guint prop_id, GValue *value, GParamSpec *pspec)
{
......@@ -508,6 +546,12 @@ gs_plugin_job_get_property (GObject *obj, guint prop_id, GValue *value, GParamSp
case PROP_TIMEOUT:
g_value_set_uint (value, self->timeout);
break;
case PROP_PERMISSION:
g_value_set_object (value, self->permission);
break;
case PROP_PERMISSION_VALUE:
g_value_set_object (value, self->permission_value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
......@@ -568,6 +612,12 @@ gs_plugin_job_set_property (GObject *obj, guint prop_id, const GValue *value, GP
case PROP_CHANNEL:
gs_plugin_job_set_channel (self, g_value_get_object (value));
break;
case PROP_PERMISSION:
gs_plugin_job_set_permission (self, g_value_get_object (value));
break;
case PROP_PERMISSION_VALUE:
gs_plugin_job_set_permission_value (self, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
......@@ -588,6 +638,7 @@ gs_plugin_job_finalize (GObject *obj)
g_clear_object (&self->review);
g_clear_object (&self->price);
g_clear_object (&self->channel);
g_clear_object (&self->permission);
G_OBJECT_CLASS (gs_plugin_job_parent_class)->finalize (obj);
}
......@@ -681,6 +732,16 @@ gs_plugin_job_class_init (GsPluginJobClass *klass)
GS_TYPE_CHANNEL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_CHANNEL, pspec);
pspec = g_param_spec_object ("permission", NULL, NULL,
GS_TYPE_PERMISSION,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PERMISSION, pspec);
pspec = g_param_spec_object ("permission-value", NULL, NULL,
GS_TYPE_PERMISSION_VALUE,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PERMISSION_VALUE, pspec);
}
static void
......
......@@ -29,6 +29,8 @@
#include "gs-category.h"
#include "gs-plugin-types.h"
#include "gs-price.h"
#include "gs-permission.h"
#include "gs-permission-value.h"
G_BEGIN_DECLS
......@@ -72,6 +74,10 @@ void gs_plugin_job_set_price (GsPluginJob *self,
GsPrice *price);
void gs_plugin_job_set_channel (GsPluginJob *self,
GsChannel *channel);
void gs_plugin_job_set_permission (GsPluginJob *self,
GsPermission *permission);
void gs_plugin_job_set_permission_value (GsPluginJob *self,
GsPermissionValue *value);
#define gs_plugin_job_newv(a,...) GS_PLUGIN_JOB(g_object_new(GS_TYPE_PLUGIN_JOB, "action", a, __VA_ARGS__))
......
......@@ -140,6 +140,12 @@ typedef gboolean (*GsPluginSwitchChannelFunc) (GsPlugin *plugin,
GsChannel *channel,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginSetPermissionFunc) (GsPlugin *plugin,
GsApp *app,
GsPermission *permission,
GsPermissionValue *value,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginReviewFunc) (GsPlugin *plugin,
GsApp *app,
AsReview *review,
......@@ -650,6 +656,15 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
cancellable, &error_local);
}
break;
case GS_PLUGIN_ACTION_SET_PERMISSION:
{
GsPluginSetPermissionFunc plugin_func = func;
ret = plugin_func (plugin, app,
gs_plugin_job_get_permission (helper->plugin_job),
gs_plugin_job_get_permission_value (helper->plugin_job),
cancellable, &error_local);
}
break;
case GS_PLUGIN_ACTION_REVIEW_SUBMIT:
case GS_PLUGIN_ACTION_REVIEW_UPVOTE:
case GS_PLUGIN_ACTION_REVIEW_DOWNVOTE:
......
......@@ -255,6 +255,7 @@ typedef enum {
* @GS_PLUGIN_ACTION_PURCHASE: Purchase an app
* @GS_PLUGIN_ACTION_DOWNLOAD: Download an application
* @GS_PLUGIN_ACTION_SWITCH_CHANNEL: Switch app channel
* @GS_PLUGIN_ACTION_SET_PERMISSION: Set app permission
*
* The plugin action.
**/
......@@ -304,6 +305,7 @@ typedef enum {
GS_PLUGIN_ACTION_PURCHASE,
GS_PLUGIN_ACTION_DOWNLOAD,
GS_PLUGIN_ACTION_SWITCH_CHANNEL,
GS_PLUGIN_ACTION_SET_PERMISSION,
/*< private >*/
GS_PLUGIN_ACTION_LAST
} GsPluginAction;
......
......@@ -41,6 +41,7 @@
#include "gs-app-list.h"
#include "gs-category.h"
#include "gs-price.h"
#include "gs-permission.h"
G_BEGIN_DECLS
......@@ -768,6 +769,26 @@ gboolean gs_plugin_app_upgrade_trigger (GsPlugin *plugin,
GCancellable *cancellable,
GError **error);
/**
* gs_plugin_app_set_permission:
* @plugin: a #GsPlugin
* @app: a #GsApp
* @permission: a #GsPermission to set
* @value: value to set for the permission
* @cancellable: a #GCancellable, or %NULL
* @error: a #GError, or %NULL
*
* Set an app permission.
*
* Returns: %TRUE for success or if not relevant
**/
gboolean gs_plugin_app_set_permission (GsPlugin *plugin,
GsApp *app,