gitee.com/mysnapcore/mysnapd@v0.1.0/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 peer=(label=unconfined), 49 50 dbus (send,receive) 51 bus=system 52 path=/org/freedesktop/login1/session/** 53 interface=org.freedesktop.login1.Session 54 peer=(label=unconfined), 55 56 dbus (send,receive) 57 bus=system 58 path=/org/freedesktop/login1 59 interface=org.freedesktop.login1.Manager 60 member={ActivateSession,GetSession,GetSeat,KillSession,ListSessions,LockSession,TerminateSession,UnlockSession} 61 peer=(label=unconfined), 62 ` 63 64 func init() { 65 registerIface(&commonInterface{ 66 name: "login-session-control", 67 summary: loginSessionControlSummary, 68 implicitOnCore: true, 69 implicitOnClassic: true, 70 baseDeclarationSlots: loginSessionControlBaseDeclarationSlots, 71 connectedPlugAppArmor: loginSessionControlConnectedPlugAppArmor, 72 }) 73 }