github.com/rigado/snapd@v2.42.5-go-mod+incompatible/interfaces/builtin/login_session_control.go (about) 1 // -*- Mode: Go; indent-tabs-mode: t -*- 2 3 /* 4 * Copyright (C) 2019 Canonical Ltd 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 3 as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 package builtin 21 22 const loginSessionControlSummary = `allows setup of login session & seat` 23 24 const loginSessionControlBaseDeclarationSlots = ` 25 login-session-control: 26 allow-installation: 27 slot-snap-type: 28 - core 29 deny-auto-connection: true 30 ` 31 32 const loginSessionControlConnectedPlugAppArmor = ` 33 # Description: Can setup login session & seat. This grants privileged access to user sessions. 34 35 #include <abstractions/dbus-strict> 36 37 dbus (send,receive) 38 bus=system 39 path=/org/freedesktop/login1/{seat,session}/** 40 interface=org.freedesktop.DBus.Properties 41 member={GetAll,PropertiesChanged,Get} 42 peer=(label=unconfined), 43 44 dbus (send,receive) 45 bus=system 46 path=/org/freedesktop/login1/seat/** 47 interface=org.freedesktop.login1.Seat 48 member={ActiveSession,SwitchTo} 49 peer=(label=unconfined), 50 51 dbus (send,receive) 52 bus=system 53 path=/org/freedesktop/login1/session/** 54 interface=org.freedesktop.login1.Session 55 member={TakeControl,TakeDevice,PauseDevice,PauseDeviceComplete,ResumeDevice,ReleaseDevice,Active,State,Lock,Unlock} 56 peer=(label=unconfined), 57 ` 58 59 func init() { 60 registerIface(&commonInterface{ 61 name: "login-session-control", 62 summary: loginSessionControlSummary, 63 implicitOnCore: true, 64 implicitOnClassic: true, 65 baseDeclarationSlots: loginSessionControlBaseDeclarationSlots, 66 connectedPlugAppArmor: loginSessionControlConnectedPlugAppArmor, 67 reservedForOS: true, 68 }) 69 }