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

  abi <abi/4.0>,

  dbus send bus=system path=/org/freedesktop/login1
       interface=org.freedesktop.DBus.Properties
       member={Get,GetAll}
       peer=(name="{@{busname},org.freedesktop.login1}", label=systemd-logind),

  dbus receive bus=system path=/org/freedesktop/login1
       interface=org.freedesktop.DBus.Properties
       member=PropertiesChanged
       peer=(name="{@{busname},org.freedesktop.login1}", label=systemd-logind),

  dbus send bus=system path=/org/freedesktop/login1
       interface=org.freedesktop.login1.Manager
       member={Inhibit,CanHibernate,CanHybridSleep,CanPowerOff,CanReboot,CanSuspend,CreateSession,GetSessionByPID}
       peer=(name="{@{busname},org.freedesktop.login1}", label=systemd-logind),

  dbus receive bus=system path=/org/freedesktop/login1
       interface=org.freedesktop.login1.Manager
       member={SessionNew,SessionRemoved,UserNew,UserRemoved,SeatNew,PrepareFor*}
       peer=(name="{@{busname},org.freedesktop.login1}", label=systemd-logind),

  dbus send bus=system path=/org/freedesktop/login1
       interface=org.freedesktop.DBus.Introspectable
       member=Introspect
       peer=(name="{@{busname},org.freedesktop.login1}", label=systemd-logind),

  dbus send bus=system path=/org/freedesktop/login1/session/*
       interface=org.freedesktop.login1.Session
       member=PauseDeviceComplete
       peer=(name=org.freedesktop.login1, label=systemd-logind),

  include if exists <abstractions/bus/org.freedesktop.login1.d>

# vim:syntax=apparmor
