174
172
The polkit actions are not considered stable and may change
175
173
from release to release so administrators should take notice
176
174
when upgrading from one version of udisks to another. For
177
example, <filename>.pkla</filename> files may need to be
178
updated to match an updated policy.
175
example, polkit authorization rules may need to be updated
176
to match an updated policy.
179
See <xref linkend="udisks-polkit-details"/> for the
180
variables that can be used to assist in determining if the
181
caller is authorized (note that each variable may not be set
182
for request). For example, a polkit authorization rule for
184
<emphasis>org.freedesktop.udisks2.filesystem-mount*</emphasis>
185
actions can use the <parameter>device</parameter> variable
186
to determine if the caller is authorized to mount a specific
190
<table frame="all" id="udisks-polkit-details">
191
<title>Known polkit variables</title>
192
<tgroup cols="2" align="left" colsep="1" rowsep="1">
201
<entry><parameter>device</parameter></entry>
202
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.PreferredDevice">Block:PreferredDevice</link> property. If set, this is guaranteed to be a device file, for example <quote>/dev/vg_lucifer/lv_root</quote> or <quote>/dev/sda1</quote>. If the object is not a block device, this is not set.</entry>
205
<entry><parameter>drive</parameter></entry>
206
<entry>Like the <parameter>device</parameter> variable, but if the object is also a drive, this variable includes Vital Product Data about the drive such as the vendor and model identifiers (if available), for example <quote>INTEL SSDSA2MH080G1GC (/dev/sda1)</quote>. Otherwise is just set to the same value as <parameter>device</parameter>. If the object is not a block device, this is not set (it is however set if the object is a block device but not a drive).</entry>
210
<entry><parameter>drive.wwn</parameter></entry>
211
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.WWN">Drive:WWN</link> property.</entry>
214
<entry><parameter>drive.serial</parameter></entry>
215
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.Serial">Drive:Serial</link> property.</entry>
218
<entry><parameter>drive.vendor</parameter></entry>
219
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.Vendor">Drive:Vendor</link> property.</entry>
222
<entry><parameter>drive.model</parameter></entry>
223
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.Model">Drive:Model</link> property.</entry>
226
<entry><parameter>drive.revision</parameter></entry>
227
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.Revision">Drive:Revision</link> property.</entry>
230
<entry><parameter>drive.removable</parameter></entry>
231
<entry>If the object is a drive (or a block device that is part of a drive), this is set to the string <quote>true</quote> only if the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Drive.Removable">Drive:Removable</link> property is <constant>TRUE</constant>.</entry>
235
<entry><parameter>id.type</parameter></entry>
236
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.IdType">Block:IdType</link> property.</entry>
239
<entry><parameter>id.usage</parameter></entry>
240
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.IdUsage">Block:IdUsage</link> property.</entry>
243
<entry><parameter>id.version</parameter></entry>
244
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.IdVersion">Block:IdVersion</link> property.</entry>
247
<entry><parameter>id.label</parameter></entry>
248
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.IdLabel">Block:IdLabel</link> property.</entry>
251
<entry><parameter>id.uuid</parameter></entry>
252
<entry>If the object is a block device, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Block.IdUUID">Block:IdUUID</link> property.</entry>
256
<entry><parameter>partition.number</parameter></entry>
257
<entry>If the object is a partition, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Partition.Number">Partition:Number</link> property.</entry>
260
<entry><parameter>partition.type</parameter></entry>
261
<entry>If the object is a partition, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Partition.Type">Partition:Type</link> property.</entry>
264
<entry><parameter>partition.flags</parameter></entry>
265
<entry>If the object is a partition, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Partition.Flags">Partition:Flags</link> property.</entry>
268
<entry><parameter>partition.name</parameter></entry>
269
<entry>If the object is a partition, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Partition.Name">Partition:Name</link> property.</entry>
272
<entry><parameter>partition.uuid</parameter></entry>
273
<entry>If the object is a partition, this property is set to the value of the <link linkend="gdbus-property-org-freedesktop-UDisks2-Partition.UUID">Partition:UUID</link> property.</entry>
179
281
For reference, the polkit actions defined by udisks &version;
180
282
are included here:
181
283
<informalexample id="udisks-polkit-actions-file"><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../data/org.freedesktop.udisks2.policy.in"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></informalexample>