Permission Store

Description

Database to store permissions

The permission store can be used by portals to store permissions that sandboxed applications have to various resources, such as files outside the sandbox.

Since the resources managed by portals can be varied, the permission store is fairly free-form: there can be multiple tables; resources are identified by an ID, as are applications, and permissions are stored as string arrays. None of these strings are interpreted by the permission store in any way.

In addition, the permission store allows to associate extra data (in the form of a GVariant) with each resource.

This document describes version 2 of the permission store interface.

Properties

org.freedesktop.impl.portal.PermissionStore:version

version readable u

Methods

org.freedesktop.impl.portal.PermissionStore.Lookup

Lookup (
  IN table s,
  IN id s,
  OUT permissions a{sas},
  OUT data v
)

Looks up the entry for a resource in one of the tables and returns all associated application permissions and data.

table

the name of the table to use

id

the resource ID to look up

permissions

map from application ID to permissions

data

data that is associated with the resource

org.freedesktop.impl.portal.PermissionStore.Set

Set (
  IN table s,
  IN create b,
  IN id s,
  IN app_permissions a{sas},
  IN data v
)

Writes the entry for a resource in the given table.

table

the name of the table to use

create

whether to create the table if it does not exist

id

the resource ID to modify

app_permissions

map from application ID to permissions

data

data to associate with the resource

org.freedesktop.impl.portal.PermissionStore.Delete

Delete (
  IN table s,
  IN id s
)

Removes the entry for a resource in the given table.

table

the name of the table to use

id

the resource ID to delete

org.freedesktop.impl.portal.PermissionStore.SetValue

SetValue (
  IN table s,
  IN create b,
  IN id s,
  IN data v
)

Sets just the data for a resource in the given table.

table

the name of the table to use

create

whether to create the table if it does not exist

id

the resource ID to modify

data

data to associate with the resource

org.freedesktop.impl.portal.PermissionStore.SetPermission

SetPermission (
  IN table s,
  IN create b,
  IN id s,
  IN app s,
  IN permissions as
)

Sets the permissions for an application and a resource in the given table.

table

the name of the table to use

create

whether to create the table if it does not exist

id

the resource ID to modify

app

the application ID to modify

permissions

permissions to set

org.freedesktop.impl.portal.PermissionStore.DeletePermission

DeletePermission (
  IN table s,
  IN id s,
  IN app s
)

Removes the entry for an application and a resource in the given table.

This method was added in version 2.

table

the name of the table to use

id

the resource ID to modify

app

the application ID to modify

org.freedesktop.impl.portal.PermissionStore.GetPermission

GetPermission (
  IN table s,
  IN id s,
  IN app s,
  OUT permissions as
)

Gets the entry for an application and a resource in the given table.

table

the name of the table to use

id

the resource ID to modify

app

the application ID to modify

permissions

permissions to get

org.freedesktop.impl.portal.PermissionStore.List

List (
  IN table s,
  OUT ids as
)

Returns all the resources that are present in the table.

table

the name of the table to use

ids

IDs of all resources that are present in the table

Signals

org.freedesktop.impl.portal.PermissionStore::Changed

Changed (
  table s,
  id s,
  deleted b,
  data v,
  permissions a{sas}
)

The Changed signal is emitted when the entry for a resource is modified or deleted. If the entry was deleted, then data and permissions contain the last values that were found in the database. If the entry was modified, they contain the new values.

table

the name of the table

id

deleted

whether the resource was deleted

data

the data that is associated the resource

permissions

the permissions that are associated with the resource