# vim:ft=apparmor
# ------------------------------------------------------------------
#
#    Copyright (C) 2026 Canonical Ltd.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
# ------------------------------------------------------------------

  # https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.FileChooser.html

  abi <abi/5.0>,

  dbus (send)
       bus=session
       path=/org/freedesktop/portal/desktop
       interface=org.freedesktop.portal.FileChooser
       member={OpenFile,SaveFile,SaveFiles}
       peer=(name=org.freedesktop.portal.Desktop),

  dbus (send)
       bus=session
       path=/org/freedesktop/portal/desktop
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll},

  dbus (receive)
       bus=session
       path=/org/freedesktop/portal/desktop/request/*/*
       interface=org.freedesktop.DBus.Properties
       member=PropertiesChanged
       peer=(name=org.freedesktop.portal.Desktop),

  # Include additions to the abstraction
  include if exists <abstractions/dbus-xdg/portal-file-chooser.d>
