# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018 Canonical Ltd
# SPDX-License-Identifier: GPL-2.0-only

# Allow communication with Evolution Data Service Calendar

  abi <abi/4.0>,

  #aa/dbus talk bus=session name=org.gnome.evolution.dataserver.{Source,Sources@{int}} path=/org/gnome/evolution/dataserver/SourceManager{,/**} label=evolution-source-registry
  # Unix: allow connection to the profile
  unix type=stream peer=(label=evolution-source-registry),
  # org.gnome.evolution.dataserver.{Source,Sources@{int}}: send and receive anything to the interface on the specific peer label
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*},org.freedesktop.DBus}", label=evolution-source-registry),
  dbus send bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*}
       peer=(name="org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*}"),
  # DBus.Properties: read and send properties
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll,Set,PropertiesChanged}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*},org.freedesktop.DBus}", label=evolution-source-registry),
  # DBus.Introspectable: allow service introspection
  dbus send bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="{@{busname},org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*},org.freedesktop.DBus}", label=evolution-source-registry),
  # DBus.ObjectManager: allow clients to enumerate sources
  dbus send bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name="{@{busname},org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*},org.freedesktop.DBus}", label=evolution-source-registry),
  dbus receive bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.freedesktop.DBus.ObjectManager
       member={InterfacesAdded,InterfacesRemoved}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.{Source,Sources@{int}}{,.*},org.freedesktop.DBus}", label=evolution-source-registry),


  #aa/dbus talk bus=session name=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory} path=/org/gnome/evolution/dataserver/Subprocess{,**} label=evolution-addressbook-factory
  # Unix: allow connection to the profile
  unix type=stream peer=(label=evolution-addressbook-factory),
  # org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}: send and receive anything to the interface on the specific peer label
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  dbus send bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}
       peer=(name="org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}"),
  # DBus.Properties: read and send properties
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll,Set,PropertiesChanged}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  # DBus.Introspectable: allow service introspection
  dbus send bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  # DBus.ObjectManager: allow clients to enumerate sources
  dbus send bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  dbus receive bus=session path=/org/gnome/evolution/dataserver/Subprocess{,**}
       interface=org.freedesktop.DBus.ObjectManager
       member={InterfacesAdded,InterfacesRemoved}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),


  #aa/dbus talk bus=session name=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory} label=evolution-addressbook-factory
  # Unix: allow connection to the profile
  unix type=stream peer=(label=evolution-addressbook-factory),
  # org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}: send and receive anything to the interface on the specific peer label
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  dbus send bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}
       peer=(name="org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*}"),
  # DBus.Properties: read and send properties
  dbus (send receive) bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll,Set,PropertiesChanged}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  # DBus.Introspectable: allow service introspection
  dbus send bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  # DBus.ObjectManager: allow clients to enumerate sources
  dbus send bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),
  dbus receive bus=session path=/org/gnome/evolution/dataserver/AddressBook{,Cursor,View,Factory}{,/**}
       interface=org.freedesktop.DBus.ObjectManager
       member={InterfacesAdded,InterfacesRemoved}
       peer=(name="{@{busname},org.gnome.evolution.dataserver.AddressBook{,Cursor,View,Factory}{,.*},org.freedesktop.DBus}", label=evolution-addressbook-factory),


  include if exists <abstractions/calendar-service.d>

# vim:syntax=apparmor
