gitee.com/mysnapcore/mysnapd@v0.1.0/interfaces/builtin/gsettings.go (about)

     1  // -*- Mode: Go; indent-tabs-mode: t -*-
     2  
     3  /*
     4   * Copyright (C) 2016 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 gsettingsSummary = `allows access to any gsettings item of current user`
    23  
    24  const gsettingsBaseDeclarationSlots = `
    25    gsettings:
    26      allow-installation:
    27        slot-snap-type:
    28          - core
    29  `
    30  
    31  const gsettingsConnectedPlugAppArmor = `
    32  # Description: Can access global gsettings of the user's session. Restricted
    33  # because this gives privileged access to sensitive information stored in
    34  # gsettings and allows adjusting settings of other applications. Future GLib
    35  # will not require plugging the interface and will instead probe if running
    36  # under confinement and use a private data store in $SNAP_USER_DATA).
    37  
    38  #include <abstractions/dbus-session-strict>
    39  
    40  #include <abstractions/dconf>
    41  owner /{,var/}run/user/*/dconf/user w,
    42  owner @{HOME}/.config/dconf/user w,
    43  dbus (receive, send)
    44      bus=session
    45      interface="ca.desrt.dconf.Writer"
    46      peer=(label=unconfined),
    47  `
    48  
    49  func init() {
    50  	registerIface(&commonInterface{
    51  		name:                  "gsettings",
    52  		summary:               gsettingsSummary,
    53  		implicitOnClassic:     true,
    54  		connectedPlugAppArmor: gsettingsConnectedPlugAppArmor,
    55  		baseDeclarationSlots:  gsettingsBaseDeclarationSlots,
    56  	})
    57  }