<p dir="ltr">Thank you very much!</p>
<p dir="ltr">I would like to see this at <a href="http://live.gnome.org">live.gnome.org</a> for others to find out.</p>
<div class="gmail_quote">El abr. 15, 2016 7:04 AM, "Alexander Larsson" <<a href="mailto:alexl@redhat.com">alexl@redhat.com</a>> escribió:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On fre, 2016-04-15 at 06:02 -0500, Daniel Espinosa wrote:<br>
> Could you add documentation about how to permissions on xdg-app. This<br>
> is because I've build an app, but it doesn't update settings, then is<br>
> every important to know each permission reach.<br>
<br>
Part 4 of my tutorial explains this a bit:<br>
<br>
<a href="https://blogs.gnome.org/alexl/2016/02/23/building-an-xdg-app-part-4/" rel="noreferrer" target="_blank">https://blogs.gnome.org/alexl/2016/02/23/building-an-xdg-app-part-4/</a><br>
<br>
I'm not sure exactly what you mean by "settings". But I assume you mean<br>
dconf/gsettings. The way to currently allow dconf access is this piece<br>
of magic:<br>
<br>
/* Needed for dconf to work */<br>
"--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",<br>
"--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf",<br>
<br>
I realize thats not easy to figure out this, but here is what it does,<br>
in order:<br>
<br>
* Allow apps to look in /run/user/1000/dconf which is a directory that<br>
dconf uses to tell you about database updates<br>
* Allow your app read-only access to ~/.config/dconf which is the <br>
default location for the per-user database. <br>
* Allow your app to talk to the dconf dbus service.<br>
* Magic environment variable to tell dconf to look in ~/.config/dconf<br>
for the dconf database instead of using XDG_CONFIG_DIR, which would<br>
point to ~/.var/app/org.something.App/config/<br>
<br>
Note that this allows your app to read settings from all other apps,<br>
which is clearly not ideal. The plan going forward is to have a<br>
gsettings backend which is explicitly designed to run sandboxed. Work<br>
has started on this, but I don't know the current state of it.<br>
<br>
> As a side note, but important too, have Software listing an app<br>
> permissions list before install it? A la Android, with explanation<br>
> about risks on each one.<br>
<br>
Yes, this is in the plans. There is APIs in libxdgapp to allow you to<br>
query the metadata for apps. This could be used by gnome-software to<br>
explain these permissions.<br>
<br>
This is not used yet, and since the work on portals are yet in its<br>
infancy all current xdg-apps request pretty broad permissions.<br>
Hopefully we will be able to change this in the near future.<br>
<br>
--<br>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
Alexander Larsson Red Hat, Inc<br>
<a href="mailto:alexl@redhat.com">alexl@redhat.com</a> <a href="mailto:alexander.larsson@gmail.com">alexander.larsson@gmail.com</a><br>
He's a fiendish chivalrous firefighter who hangs with the wrong crowd.<br>
She's a wealthy motormouth pearl diver descended from a line of powerful<br>
witches. They fight crime!<br>
<br>
<br>
</blockquote></div>