Update to version 2.33.1
[profile/ivi/glib2.git] / docs / reference / gio / html / GPermission.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GPermission</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="permissions.html" title="Permissions">
9 <link rel="prev" href="permissions.html" title="Permissions">
10 <link rel="next" href="GSimplePermission.html" title="GSimplePermission">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="permissions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="permissions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GSimplePermission.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GPermission.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GPermission.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GPermission.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#GPermission.properties" class="shortcut">Properties</a>
31 </td></tr>
32 </table>
33 <div class="refentry">
34 <a name="GPermission"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
36 <td valign="top">
37 <h2><span class="refentrytitle"><a name="GPermission.top_of_page"></a>GPermission</span></h2>
38 <p>GPermission — An object representing the permission to perform
39                     a certain action</p>
40 </td>
41 <td valign="top" align="right"></td>
42 </tr></table></div>
43 <div class="refsynopsisdiv">
44 <a name="GPermission.synopsis"></a><h2>Synopsis</h2>
45 <pre class="synopsis">                    <a class="link" href="GPermission.html#GPermission-struct" title="GPermission">GPermission</a>;
46 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-get-allowed" title="g_permission_get_allowed ()">g_permission_get_allowed</a>            (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);
47 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-get-can-acquire" title="g_permission_get_can_acquire ()">g_permission_get_can_acquire</a>        (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);
48 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-get-can-release" title="g_permission_get_can_release ()">g_permission_get_can_release</a>        (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);
49
50 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-acquire" title="g_permission_acquire ()">g_permission_acquire</a>                (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
51                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
52                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
53 <span class="returnvalue">void</span>                <a class="link" href="GPermission.html#g-permission-acquire-async" title="g_permission_acquire_async ()">g_permission_acquire_async</a>          (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
54                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
55                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
56                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
57 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-acquire-finish" title="g_permission_acquire_finish ()">g_permission_acquire_finish</a>         (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
58                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
59                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
60 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-release" title="g_permission_release ()">g_permission_release</a>                (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
61                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
62                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
63 <span class="returnvalue">void</span>                <a class="link" href="GPermission.html#g-permission-release-async" title="g_permission_release_async ()">g_permission_release_async</a>          (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
64                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
65                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
66                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
67 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GPermission.html#g-permission-release-finish" title="g_permission_release_finish ()">g_permission_release_finish</a>         (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
68                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
69                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
70
71 <span class="returnvalue">void</span>                <a class="link" href="GPermission.html#g-permission-impl-update" title="g_permission_impl_update ()">g_permission_impl_update</a>            (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
72                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>,
73                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> can_acquire</code></em>,
74                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> can_release</code></em>);
75 </pre>
76 </div>
77 <div class="refsect1">
78 <a name="GPermission.object-hierarchy"></a><h2>Object Hierarchy</h2>
79 <pre class="synopsis">
80   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
81    +----GPermission
82          +----<a class="link" href="GSimplePermission.html" title="GSimplePermission">GSimplePermission</a>
83 </pre>
84 </div>
85 <div class="refsect1">
86 <a name="GPermission.properties"></a><h2>Properties</h2>
87 <pre class="synopsis">
88   "<a class="link" href="GPermission.html#GPermission--allowed" title='The "allowed" property'>allowed</a>"                  <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read
89   "<a class="link" href="GPermission.html#GPermission--can-acquire" title='The "can-acquire" property'>can-acquire</a>"              <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read
90   "<a class="link" href="GPermission.html#GPermission--can-release" title='The "can-release" property'>can-release</a>"              <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read
91 </pre>
92 </div>
93 <div class="refsect1">
94 <a name="GPermission.description"></a><h2>Description</h2>
95 <p>
96 A <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> represents the status of the caller's permission to
97 perform a certain action.
98 </p>
99 <p>
100 You can query if the action is currently allowed and if it is
101 possible to acquire the permission so that the action will be allowed
102 in the future.
103 </p>
104 <p>
105 There is also an API to actually acquire the permission and one to
106 release it.
107 </p>
108 <p>
109 As an example, a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> might represent the ability for the
110 user to write to a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object.  This <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> object could
111 then be used to decide if it is appropriate to show a "Click here to
112 unlock" button in a dialog and to provide the mechanism to invoke
113 when that button is clicked.
114 </p>
115 </div>
116 <div class="refsect1">
117 <a name="GPermission.details"></a><h2>Details</h2>
118 <div class="refsect2">
119 <a name="GPermission-struct"></a><h3>GPermission</h3>
120 <pre class="programlisting">typedef struct _GPermission GPermission;</pre>
121 <p>
122 <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> is an opaque data structure and can only be accessed
123 using the following functions.
124 </p>
125 </div>
126 <hr>
127 <div class="refsect2">
128 <a name="g-permission-get-allowed"></a><h3>g_permission_get_allowed ()</h3>
129 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_get_allowed            (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);</pre>
130 <p>
131 Gets the value of the 'allowed' property.  This property is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if
132 the caller currently has permission to perform the action that
133 <em class="parameter"><code>permission</code></em> represents the permission to perform.
134 </p>
135 <div class="variablelist"><table border="0">
136 <col align="left" valign="top">
137 <tbody>
138 <tr>
139 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
140 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
141 </tr>
142 <tr>
143 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
144 <td>the value of the 'allowed' property</td>
145 </tr>
146 </tbody>
147 </table></div>
148 <p class="since">Since 2.26</p>
149 </div>
150 <hr>
151 <div class="refsect2">
152 <a name="g-permission-get-can-acquire"></a><h3>g_permission_get_can_acquire ()</h3>
153 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_get_can_acquire        (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);</pre>
154 <p>
155 Gets the value of the 'can-acquire' property.  This property is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
156 if it is generally possible to acquire the permission by calling
157 <a class="link" href="GPermission.html#g-permission-acquire" title="g_permission_acquire ()"><code class="function">g_permission_acquire()</code></a>.
158 </p>
159 <div class="variablelist"><table border="0">
160 <col align="left" valign="top">
161 <tbody>
162 <tr>
163 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
164 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
165 </tr>
166 <tr>
167 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
168 <td>the value of the 'can-acquire' property</td>
169 </tr>
170 </tbody>
171 </table></div>
172 <p class="since">Since 2.26</p>
173 </div>
174 <hr>
175 <div class="refsect2">
176 <a name="g-permission-get-can-release"></a><h3>g_permission_get_can_release ()</h3>
177 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_get_can_release        (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>);</pre>
178 <p>
179 Gets the value of the 'can-release' property.  This property is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
180 if it is generally possible to release the permission by calling
181 <a class="link" href="GPermission.html#g-permission-release" title="g_permission_release ()"><code class="function">g_permission_release()</code></a>.
182 </p>
183 <div class="variablelist"><table border="0">
184 <col align="left" valign="top">
185 <tbody>
186 <tr>
187 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
188 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
189 </tr>
190 <tr>
191 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
192 <td>the value of the 'can-release' property</td>
193 </tr>
194 </tbody>
195 </table></div>
196 <p class="since">Since 2.26</p>
197 </div>
198 <hr>
199 <div class="refsect2">
200 <a name="g-permission-acquire"></a><h3>g_permission_acquire ()</h3>
201 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_acquire                (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
202                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
203                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
204 <p>
205 Attempts to acquire the permission represented by <em class="parameter"><code>permission</code></em>.
206 </p>
207 <p>
208 The precise method by which this happens depends on the permission
209 and the underlying authentication mechanism.  A simple example is
210 that a dialog may appear asking the user to enter their password.
211 </p>
212 <p>
213 You should check with <a class="link" href="GPermission.html#g-permission-get-can-acquire" title="g_permission_get_can_acquire ()"><code class="function">g_permission_get_can_acquire()</code></a> before calling
214 this function.
215 </p>
216 <p>
217 If the permission is acquired then <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.  Otherwise,
218 <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em> is set appropriately.
219 </p>
220 <p>
221 This call is blocking, likely for a very long time (in the case that
222 user interaction is required).  See <a class="link" href="GPermission.html#g-permission-acquire-async" title="g_permission_acquire_async ()"><code class="function">g_permission_acquire_async()</code></a> for
223 the non-blocking version.
224 </p>
225 <div class="variablelist"><table border="0">
226 <col align="left" valign="top">
227 <tbody>
228 <tr>
229 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
230 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
231 </tr>
232 <tr>
233 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
234 <td>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
235 </td>
236 </tr>
237 <tr>
238 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
239 <td>a pointer to a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
240 </td>
241 </tr>
242 <tr>
243 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
244 <td>
245 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the permission was successfully acquired</td>
246 </tr>
247 </tbody>
248 </table></div>
249 <p class="since">Since 2.26</p>
250 </div>
251 <hr>
252 <div class="refsect2">
253 <a name="g-permission-acquire-async"></a><h3>g_permission_acquire_async ()</h3>
254 <pre class="programlisting"><span class="returnvalue">void</span>                g_permission_acquire_async          (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
255                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
256                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
257                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
258 <p>
259 Attempts to acquire the permission represented by <em class="parameter"><code>permission</code></em>.
260 </p>
261 <p>
262 This is the first half of the asynchronous version of
263 <a class="link" href="GPermission.html#g-permission-acquire" title="g_permission_acquire ()"><code class="function">g_permission_acquire()</code></a>.
264 </p>
265 <div class="variablelist"><table border="0">
266 <col align="left" valign="top">
267 <tbody>
268 <tr>
269 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
270 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
271 </tr>
272 <tr>
273 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
274 <td>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
275 </td>
276 </tr>
277 <tr>
278 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
279 <td>the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when done</td>
280 </tr>
281 <tr>
282 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
283 <td>the user data to pass to <em class="parameter"><code>callback</code></em>
284 </td>
285 </tr>
286 </tbody>
287 </table></div>
288 <p class="since">Since 2.26</p>
289 </div>
290 <hr>
291 <div class="refsect2">
292 <a name="g-permission-acquire-finish"></a><h3>g_permission_acquire_finish ()</h3>
293 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_acquire_finish         (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
294                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
295                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
296 <p>
297 Collects the result of attempting to acquire the permission
298 represented by <em class="parameter"><code>permission</code></em>.
299 </p>
300 <p>
301 This is the second half of the asynchronous version of
302 <a class="link" href="GPermission.html#g-permission-acquire" title="g_permission_acquire ()"><code class="function">g_permission_acquire()</code></a>.
303 </p>
304 <div class="variablelist"><table border="0">
305 <col align="left" valign="top">
306 <tbody>
307 <tr>
308 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
309 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
310 </tr>
311 <tr>
312 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
313 <td>the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> given to the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>
314 </td>
315 </tr>
316 <tr>
317 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
318 <td>a pointer to a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
319 </td>
320 </tr>
321 <tr>
322 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
323 <td>
324 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the permission was successfully acquired</td>
325 </tr>
326 </tbody>
327 </table></div>
328 <p class="since">Since 2.26</p>
329 </div>
330 <hr>
331 <div class="refsect2">
332 <a name="g-permission-release"></a><h3>g_permission_release ()</h3>
333 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_release                (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
334                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
335                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
336 <p>
337 Attempts to release the permission represented by <em class="parameter"><code>permission</code></em>.
338 </p>
339 <p>
340 The precise method by which this happens depends on the permission
341 and the underlying authentication mechanism.  In most cases the
342 permission will be dropped immediately without further action.
343 </p>
344 <p>
345 You should check with <a class="link" href="GPermission.html#g-permission-get-can-release" title="g_permission_get_can_release ()"><code class="function">g_permission_get_can_release()</code></a> before calling
346 this function.
347 </p>
348 <p>
349 If the permission is released then <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.  Otherwise,
350 <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em> is set appropriately.
351 </p>
352 <p>
353 This call is blocking, likely for a very long time (in the case that
354 user interaction is required).  See <a class="link" href="GPermission.html#g-permission-release-async" title="g_permission_release_async ()"><code class="function">g_permission_release_async()</code></a> for
355 the non-blocking version.
356 </p>
357 <div class="variablelist"><table border="0">
358 <col align="left" valign="top">
359 <tbody>
360 <tr>
361 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
362 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
363 </tr>
364 <tr>
365 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
366 <td>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
367 </td>
368 </tr>
369 <tr>
370 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
371 <td>a pointer to a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
372 </td>
373 </tr>
374 <tr>
375 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
376 <td>
377 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the permission was successfully released</td>
378 </tr>
379 </tbody>
380 </table></div>
381 <p class="since">Since 2.26</p>
382 </div>
383 <hr>
384 <div class="refsect2">
385 <a name="g-permission-release-async"></a><h3>g_permission_release_async ()</h3>
386 <pre class="programlisting"><span class="returnvalue">void</span>                g_permission_release_async          (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
387                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
388                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
389                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
390 <p>
391 Attempts to release the permission represented by <em class="parameter"><code>permission</code></em>.
392 </p>
393 <p>
394 This is the first half of the asynchronous version of
395 <a class="link" href="GPermission.html#g-permission-release" title="g_permission_release ()"><code class="function">g_permission_release()</code></a>.
396 </p>
397 <div class="variablelist"><table border="0">
398 <col align="left" valign="top">
399 <tbody>
400 <tr>
401 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
402 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
403 </tr>
404 <tr>
405 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
406 <td>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
407 </td>
408 </tr>
409 <tr>
410 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
411 <td>the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when done</td>
412 </tr>
413 <tr>
414 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
415 <td>the user data to pass to <em class="parameter"><code>callback</code></em>
416 </td>
417 </tr>
418 </tbody>
419 </table></div>
420 <p class="since">Since 2.26</p>
421 </div>
422 <hr>
423 <div class="refsect2">
424 <a name="g-permission-release-finish"></a><h3>g_permission_release_finish ()</h3>
425 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_permission_release_finish         (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
426                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
427                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
428 <p>
429 Collects the result of attempting to release the permission
430 represented by <em class="parameter"><code>permission</code></em>.
431 </p>
432 <p>
433 This is the second half of the asynchronous version of
434 <a class="link" href="GPermission.html#g-permission-release" title="g_permission_release ()"><code class="function">g_permission_release()</code></a>.
435 </p>
436 <div class="variablelist"><table border="0">
437 <col align="left" valign="top">
438 <tbody>
439 <tr>
440 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
441 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
442 </tr>
443 <tr>
444 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
445 <td>the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> given to the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>
446 </td>
447 </tr>
448 <tr>
449 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
450 <td>a pointer to a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
451 </td>
452 </tr>
453 <tr>
454 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
455 <td>
456 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the permission was successfully released</td>
457 </tr>
458 </tbody>
459 </table></div>
460 <p class="since">Since 2.26</p>
461 </div>
462 <hr>
463 <div class="refsect2">
464 <a name="g-permission-impl-update"></a><h3>g_permission_impl_update ()</h3>
465 <pre class="programlisting"><span class="returnvalue">void</span>                g_permission_impl_update            (<em class="parameter"><code><a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> *permission</code></em>,
466                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>,
467                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> can_acquire</code></em>,
468                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> can_release</code></em>);</pre>
469 <p>
470 This function is called by the <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> implementation to update
471 the properties of the permission.  You should never call this
472 function except from a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> implementation.
473 </p>
474 <p>
475 GObject notify signals are generated, as appropriate.
476 </p>
477 <div class="variablelist"><table border="0">
478 <col align="left" valign="top">
479 <tbody>
480 <tr>
481 <td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
482 <td>a <a class="link" href="GPermission.html" title="GPermission"><span class="type">GPermission</span></a> instance</td>
483 </tr>
484 <tr>
485 <td><p><span class="term"><em class="parameter"><code>allowed</code></em> :</span></p></td>
486 <td>the new value for the 'allowed' property</td>
487 </tr>
488 <tr>
489 <td><p><span class="term"><em class="parameter"><code>can_acquire</code></em> :</span></p></td>
490 <td>the new value for the 'can-acquire' property</td>
491 </tr>
492 <tr>
493 <td><p><span class="term"><em class="parameter"><code>can_release</code></em> :</span></p></td>
494 <td>the new value for the 'can-release' property</td>
495 </tr>
496 </tbody>
497 </table></div>
498 <p class="since">Since 2.26</p>
499 </div>
500 </div>
501 <div class="refsect1">
502 <a name="GPermission.property-details"></a><h2>Property Details</h2>
503 <div class="refsect2">
504 <a name="GPermission--allowed"></a><h3>The <code class="literal">"allowed"</code> property</h3>
505 <pre class="programlisting">  "allowed"                  <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read</pre>
506 <p>
507 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the caller currently has permission to perform the action that
508 <em class="parameter"><code>permission</code></em> represents the permission to perform.
509 </p>
510 <p>Default value: FALSE</p>
511 </div>
512 <hr>
513 <div class="refsect2">
514 <a name="GPermission--can-acquire"></a><h3>The <code class="literal">"can-acquire"</code> property</h3>
515 <pre class="programlisting">  "can-acquire"              <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read</pre>
516 <p>
517 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if it is generally possible to acquire the permission by calling
518 <a class="link" href="GPermission.html#g-permission-acquire" title="g_permission_acquire ()"><code class="function">g_permission_acquire()</code></a>.
519 </p>
520 <p>Default value: FALSE</p>
521 </div>
522 <hr>
523 <div class="refsect2">
524 <a name="GPermission--can-release"></a><h3>The <code class="literal">"can-release"</code> property</h3>
525 <pre class="programlisting">  "can-release"              <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read</pre>
526 <p>
527 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if it is generally possible to release the permission by calling
528 <a class="link" href="GPermission.html#g-permission-release" title="g_permission_release ()"><code class="function">g_permission_release()</code></a>.
529 </p>
530 <p>Default value: FALSE</p>
531 </div>
532 </div>
533 </div>
534 <div class="footer">
535 <hr>
536           Generated by GTK-Doc V1.18</div>
537 </body>
538 </html>