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

abi <abi/3.0>,

include <tunables/global>

@{exec_path} = @{bin}/gnome-calendar
profile gnome-calendar @{exec_path} {
  include <abstractions/base>
  include <abstractions/bus-accessibility>
  include <abstractions/bus-system>
  include <abstractions/bus/org.a11y>
  include <abstractions/bus/org.freedesktop.login1>
  include <abstractions/bus/org.freedesktop.NetworkManager>
  include <abstractions/bus/org.freedesktop.portal.Desktop>
  include <abstractions/bus/org.freedesktop.timedate1>
  include <abstractions/common/gnome>
  include <abstractions/nameservice-strict>
  include <abstractions/p11-kit>
  include <abstractions/ssl_certs>

  network netlink raw,

  #aa:dbus own bus=session name=org.gnome.Calendar

  #aa:dbus talk bus=session name=org.gnome.evolution.dataserver.AddressBook@{int} label=evolution-addressbook-factory 
  #aa:dbus talk bus=session name=org.gnome.evolution.dataserver.Calendar@{int} label=evolution-calendar-factory
  #aa:dbus talk bus=session name=org.gnome.evolution.dataserver.CalendarView label=evolution-calendar-factory
  #aa:dbus talk bus=session name=org.gnome.evolution.dataserver.Source label=evolution-source-registry
  #aa:dbus talk bus=session name=org.gnome.evolution.dataserver.Sources@{int} label=evolution-source-registry
  #aa:dbus talk bus=session name=org.gnome.OnlineAccounts label=goa-daemon
  #aa:dbus talk bus=session name=org.gnome.SettingsDaemon.Color label=gsd-color
  #aa:dbus talk bus=system name=org.freedesktop.GeoClue2 label=geoclue

  dbus send bus=session path=/org/gnome/evolution/dataserver/SourceManager{,/**}
       interface=org.freedesktop.DBus.ObjectManager
       member=GetManagedObjects
       peer=(name=:*, label=evolution-source-registry),

  @{exec_path} mr,

  /usr/share/evolution-data-server/{,**} r,
  /usr/share/libgweather/Locations.xml r,

  include if exists <local/gnome-calendar>
}
