2 "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
3 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
6 Copyright (C) 2015 Red Hat, Inc.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General
19 Public License along with this library; if not, write to the
20 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
23 Author: Alexander Larsson <alexl@redhat.com>
26 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
28 org.freedesktop.portal.Documents:
29 @short_description: Document portal
31 The document portal allows to make files from the outside world
32 available to sandboxed applications in a controlled way.
34 Exported files will be made accessible to the application via
35 a fuse filesystem that gets mounted at /run/user/$UID/doc/. The
36 filesystem gets mounted both outside and inside the sandbox, but
37 the view inside the sandbox is restricted to just those files
38 that the application is allowed to access.
40 Individual files will appear at /run/user/$UID/doc/$DOC_ID/filename,
41 where $DOC_ID is the ID of the file in the document store. It is
42 returned by the org.freedesktop.portal.Documents.Add() and
43 org.freedesktop.portal.Documents.AddNamed() calls.
45 The permissions that the application has for a document store entry
46 (see org.freedesktop.portal.Documents.GrantPermissions()) are reflected
47 in the POSIX mode bits in the fuse filesystem.
49 <interface name='org.freedesktop.portal.Documents'>
50 <property name="version" type="u" access="read"/>
54 @path: the path at which the fuse filesystem is mounted
56 Returns the path at which the document store fuse filesystem
57 is mounted. This will typically be /run/user/$UID/doc/.
59 <method name="GetMountPoint">
60 <arg type='ay' name='path' direction='out'/>
65 @o_path_fd: open file descriptor for the file to add
66 @reuse_existing: whether to reuse an existing document store entry for the file
67 @persistent: whether to add the file only for this session or permanently
68 @doc_id: the ID of the file in the document store
70 Adds a file to the document store. The file is passed in the
71 form of an open file descriptor to prove that the caller has
75 <arg type='h' name='o_path_fd' direction='in'/>
76 <arg type='b' name='reuse_existing' direction='in'/>
77 <arg type='b' name='persistent' direction='in'/>
78 <arg type='s' name='doc_id' direction='out'/>
83 @o_path_parent_fd: open file descriptor for the parent directory
84 @filename: the basename for the file
85 @reuse_existing: whether to reuse an existing document store entry for the file
86 @persistent: whether to add the file only for this session or permanently
87 @doc_id: the ID of the file in the document store
89 Creates an entry in the document store for writing a new file.
91 <method name="AddNamed">
92 <arg type='h' name='o_path_parent_fd' direction='in'/>
93 <arg type='ay' name='filename' direction='in'/>
94 <arg type='b' name='reuse_existing' direction='in'/>
95 <arg type='b' name='persistent' direction='in'/>
96 <arg type='s' name='doc_id' direction='out'/>
101 @o_path_fds: open file descriptors for the files to export
102 @flags: flags, 1 == reuse_existing, 2 == persistent
103 @app_id: an application ID, or empty string
104 @permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
105 @doc_ids: the IDs of the files in the document store
106 @extra_info: Extra info returned
108 Adds multiple files to the document store. The file is passed in the
109 form of an open file descriptor to prove that the caller has
112 Additionally, if app_id is specified, it will be given the permissions
113 listed in GrantPermission.
115 The method also returns some extra info that can be used to avoid
116 multiple roundtrips. For now it only contains as "mountpoint", the
117 fuse mountpoint of the document portal.
119 This method was added in version 2 of the org.freedesktop.portal.Documents interface.
121 <method name="AddFull">
122 <arg type='ah' name='o_path_fds' direction='in'/>
123 <arg type='u' name='flags' direction='in'/>
124 <arg type='s' name='app_id' direction='in'/>
125 <arg type='as' name='permissions' direction='in'/>
126 <arg type='as' name='doc_ids' direction='out'/>
127 <arg type='a{sv}' name='extra_out' direction='out'/>
132 @doc_id: the ID of the file in the document store
133 @app_id: the ID of the application to which permissions are granted
134 @permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
136 Grants access permissions for a file in the document store
139 This call is available inside the sandbox if the application
140 has the 'grant-permissions' permission for the document.
142 <method name="GrantPermissions">
143 <arg type='s' name='doc_id' direction='in'/>
144 <arg type='s' name='app_id' direction='in'/>
145 <arg type='as' name='permissions' direction='in'/>
150 @doc_id: the ID of the file in the document store
151 @app_id: the ID of the application to which permissions are granted
152 @permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
154 Revokes access permissions for a file in the document store
157 This call is available inside the sandbox if the application
158 has the 'grant-permissions' permission for the document.
160 <method name="RevokePermissions">
161 <arg type='s' name='doc_id' direction='in'/>
162 <arg type='s' name='app_id' direction='in'/>
163 <arg type='as' name='permissions' direction='in'/>
168 @doc_id: the ID of the file in the document store
170 Removes an entry from the document store. The file itself is
173 This call is available inside the sandbox if the application
174 has the 'delete' permission for the document.
176 <method name="Delete">
177 <arg type='s' name='doc_id' direction='in'/>
182 @filename: a path in the host filesystem
183 @doc_id: the ID of the file in the document store, or '' if the file is not in the document store
185 Looks up the document ID for a file.
187 This call is no not available inside the sandbox.
189 <method name="Lookup">
190 <arg type='ay' name='filename' direction='in'/>
191 <arg type='s' name='doc_id' direction='out'/>
196 @doc_id: the ID of the file in the document store
197 @path: the path for the file in the host filesystem
198 @apps: a dictionary mapping application IDs to the permissions for that application
200 Gets the filesystem path and application permissions for a document store
203 This call is not available inside the sandbox.
206 <arg type='s' name='doc_id' direction='in'/>
207 <arg type='ay' name='path' direction='out'/>
208 <arg type='a{sas}' name='apps' direction='out'/>
213 @app_id: an application ID, or '' to list all documents
214 @docs: a dictonary mapping document IDs to their filesystem path
216 Lists documents in the document store for an application (or for
219 This call is not available inside the sandbox.
222 <arg type='s' name='app_id' direction='in'/>
223 <arg type='a{say}' name='docs' direction='out'/>