summaryrefslogtreecommitdiff
path: root/document-portal/xdp-util.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2015-09-04 14:46:02 +0200
committerAlexander Larsson <alexl@redhat.com>2015-09-04 14:46:02 +0200
commit7ad47c74ea08ef9afc1732d0858a0ada16ff72e3 (patch)
treee97c3d23daa391013a1713ec75845181cbd34818 /document-portal/xdp-util.c
parent83201bd7e4acb4185b6e7978a751b97cc63a0549 (diff)
downloadxdg-app-7ad47c74ea08ef9afc1732d0858a0ada16ff72e3.tar.gz
document-portals: Support unique documents
These document id will not be shared for multiple users. The main difference is this this makes it safe for the creating app to delete the document if he wants to (i.e. for temporary docs), and thus we can grant this additional permission for the calling app.
Diffstat (limited to 'document-portal/xdp-util.c')
-rw-r--r--document-portal/xdp-util.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/document-portal/xdp-util.c b/document-portal/xdp-util.c
index d0c6d59..51c4daf 100644
--- a/document-portal/xdp-util.c
+++ b/document-portal/xdp-util.c
@@ -51,7 +51,7 @@ xdp_parse_permissions (const char **permissions)
XdpPermissionFlags
xdp_entry_get_permissions (XdgAppDbEntry *entry,
- const char *app_id)
+ const char *app_id)
{
g_autofree const char **permissions = NULL;
@@ -64,8 +64,8 @@ xdp_entry_get_permissions (XdgAppDbEntry *entry,
gboolean
xdp_entry_has_permissions (XdgAppDbEntry *entry,
- const char *app_id,
- XdpPermissionFlags perms)
+ const char *app_id,
+ XdpPermissionFlags perms)
{
XdpPermissionFlags current_perms;
@@ -126,6 +126,14 @@ xdp_entry_get_inode (XdgAppDbEntry *entry)
return g_variant_get_uint64 (c);
}
+guint32
+xdp_entry_get_flags (XdgAppDbEntry *entry)
+{
+ g_autoptr(GVariant) v = xdg_app_db_entry_get_data (entry);
+ g_autoptr(GVariant) c = g_variant_get_child_value (v, 3);
+ return g_variant_get_uint32 (c);
+}
+
int
xdp_entry_open_dir (XdgAppDbEntry *entry)
{