# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Mikhail Morfikov
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{lib}/{,gvfs/}gvfs-goa-volume-monitor
profile gvfs-goa-volume-monitor @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-session>

  #aa:dbus own bus=session name=org.gtk.vfs.GoaVolumeMonitor interface=org.gtk.Private.RemoteVolumeMonitor path=/org/gtk/Private/RemoteVolumeMonitor

  dbus receive bus=session
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect 
       peer=(name=:*, label=gnome-shell),

  dbus send bus=session path=/org/gnome/OnlineAccounts
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name=:*, label=goa-daemon),

  @{exec_path} mr,

  include if exists <local/gvfs-goa-volume-monitor>
}
