0

I am asking, because I have to handle a permission problem with a Firefox webextension and the sandboxed Firefox in Ubuntu 22.04. (See https://github.com/mi-g/vdhcoapp/issues/139)

The solution turns out to be, I have to grant permission for Firefox to use that webextension. But I only find such commands in Flatpak's permission-show and permission-set, which means I have to install Flatpak to modify the permission of a snap application. That's weird.

Is there any permission managing scheme in snap itself? If not, why?

mpboden
  • 3,046
cyfex
  • 81

2 Answers2

1

You can set the permission through dbus, the command bellow will set the permissions using the current user session and does not need flatpak installed. There are other methods in also, see documentation.

dbus-send --print-reply \
    --dest=org.freedesktop.impl.portal.PermissionStore \
    /org/freedesktop/impl/portal/PermissionStore \
    org.freedesktop.impl.portal.PermissionStore.SetPermission \
    string:'webextensions' \
    boolean:'true' \
    string:'<your-extension>' \
    string:'snap.firefox' \
    array:string:'yes'

There is no way that I found to set the permissions for the system, this has to be done per session.

mlso
  • 26
0

Thank el-calavera in this link: https://github.com/mi-g/vdhcoapp/issues/139#issuecomment-1535179270 that answers my question.

I will just quote her/his answer here:

"Native messenging in snap is using the xdg-desktop-portal framework which grew out of the flatpak project. This is why permissions are stored in a file called ~/.local/share/flatpak/db/webextensions . Flatpak provides a way to edit this file, snap does not."

That means we have to use flatpak to manage these permissions regarding native messaging.

cyfex
  • 81