ACC SHELL
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Authorization Constraints</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="PolicyKit Library Reference Manual">
<link rel="up" href="ref-core.html" title="Core API Reference">
<link rel="prev" href="polkit-Authorization-Entry.html" title="Authorization Entry">
<link rel="next" href="polkit-Authorization-Database.html" title="Authorization Database">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="polkit-Authorization-Entry.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ref-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">PolicyKit Library Reference Manual</th>
<td><a accesskey="n" href="polkit-Authorization-Database.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#polkit-Authorization-Constraints.synopsis" class="shortcut">Top</a>
|
<a href="#polkit-Authorization-Constraints.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Authorization Constraints">
<a name="polkit-Authorization-Constraints"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="polkit-Authorization-Constraints.top_of_page"></a>Authorization Constraints</span></h2>
<p>Authorization Constraints — Conditions that must be satisfied in
order for an authorization to apply</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="polkit-Authorization-Constraints.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">enum <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraintType" title="enum PolKitAuthorizationConstraintType">PolKitAuthorizationConstraintType</a>;
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint">PolKitAuthorizationConstraint</a>;
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-require-local" title="polkit_authorization_constraint_get_require_local ()">polkit_authorization_constraint_get_require_local</a>
(<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-require-active" title="polkit_authorization_constraint_get_require_active ()">polkit_authorization_constraint_get_require_active</a>
(<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-require-exe" title="polkit_authorization_constraint_get_require_exe ()">polkit_authorization_constraint_get_require_exe</a>
(<em class="parameter"><code>const <span class="type">char</span> *path</code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-require-selinux-context" title="polkit_authorization_constraint_get_require_selinux_context ()">polkit_authorization_constraint_get_require_selinux_context</a>
(<em class="parameter"><code>const <span class="type">char</span> *context</code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-ref" title="polkit_authorization_constraint_ref ()">polkit_authorization_constraint_ref</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
<span class="returnvalue">void</span> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-unref" title="polkit_authorization_constraint_unref ()">polkit_authorization_constraint_unref</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
<span class="returnvalue">void</span> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-debug" title="polkit_authorization_constraint_debug ()">polkit_authorization_constraint_debug</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
<a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-validate" title="polkit_authorization_constraint_validate ()">polkit_authorization_constraint_validate</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraintType" title="enum PolKitAuthorizationConstraintType"><span class="returnvalue">PolKitAuthorizationConstraintType</span></a> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-type" title="polkit_authorization_constraint_type ()">polkit_authorization_constraint_type</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-exe" title="polkit_authorization_constraint_get_exe ()">polkit_authorization_constraint_get_exe</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-selinux-context" title="polkit_authorization_constraint_get_selinux_context ()">polkit_authorization_constraint_get_selinux_context</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);
<a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-check-session" title="polkit_authorization_constraint_check_session ()">polkit_authorization_constraint_check_session</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Session.html#PolKitSession" title="PolKitSession"><span class="type">PolKitSession</span></a> *session</code></em>);
<a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-check-caller" title="polkit_authorization_constraint_check_caller ()">polkit_authorization_constraint_check_caller</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Caller.html#PolKitCaller" title="PolKitCaller"><span class="type">PolKitCaller</span></a> *caller</code></em>);
<span class="returnvalue">size_t</span> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-to-string" title="polkit_authorization_constraint_to_string ()">polkit_authorization_constraint_to_string</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><span class="type">char</span> *out_buf</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buf_size</code></em>);
<a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-from-string" title="polkit_authorization_constraint_from_string ()">polkit_authorization_constraint_from_string</a>
(<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);
<span class="returnvalue">int</span> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-from-caller" title="polkit_authorization_constraint_get_from_caller ()">polkit_authorization_constraint_get_from_caller</a>
(<em class="parameter"><code><a class="link" href="polkit-Caller.html#PolKitCaller" title="PolKitCaller"><span class="type">PolKitCaller</span></a> *caller</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> **out_array</code></em>,
<em class="parameter"><code><span class="type">size_t</span> array_size</code></em>);
<a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> <a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-equal" title="polkit_authorization_constraint_equal ()">polkit_authorization_constraint_equal</a>
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *a</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *b</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="polkit-Authorization-Constraints.description"></a><h2>Description</h2>
<p>
This class is used to represent conditions that must be satisfied
in order for an authorization to apply
</p>
</div>
<div class="refsect1" title="Details">
<a name="polkit-Authorization-Constraints.details"></a><h2>Details</h2>
<div class="refsect2" title="enum PolKitAuthorizationConstraintType">
<a name="PolKitAuthorizationConstraintType"></a><h3>enum PolKitAuthorizationConstraintType</h3>
<pre class="programlisting">typedef enum {
POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_LOCAL,
POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_ACTIVE,
POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_EXE,
POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_SELINUX_CONTEXT
} PolKitAuthorizationConstraintType;
</pre>
<p>
This enumeration describes the type of the authorization
constraint.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-LOCAL:CAPS"></a><span class="term"><code class="literal">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_LOCAL</code></span></p></td>
<td>the session or
caller must be local
</td>
</tr>
<tr>
<td><p><a name="POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-ACTIVE:CAPS"></a><span class="term"><code class="literal">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_ACTIVE</code></span></p></td>
<td>the session or
caller must be in an active local session
</td>
</tr>
<tr>
<td><p><a name="POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-EXE:CAPS"></a><span class="term"><code class="literal">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_EXE</code></span></p></td>
<td>the caller must
be a specific program; use
<a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-exe" title="polkit_authorization_constraint_get_exe ()"><code class="function">polkit_authorization_constraint_get_exe()</code></a> to get the path of the
program.
</td>
</tr>
<tr>
<td><p><a name="POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-SELINUX-CONTEXT:CAPS"></a><span class="term"><code class="literal">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_SELINUX_CONTEXT</code></span></p></td>
<td>the
caller must be in a specific security context; use
<a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-get-selinux-context" title="polkit_authorization_constraint_get_selinux_context ()"><code class="function">polkit_authorization_constraint_get_selinux_context()</code></a> to get the
security context.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="PolKitAuthorizationConstraint">
<a name="PolKitAuthorizationConstraint"></a><h3>PolKitAuthorizationConstraint</h3>
<pre class="programlisting">typedef struct _PolKitAuthorizationConstraint PolKitAuthorizationConstraint;</pre>
<p>
Instances of this class are used to represent conditions that must
be satisfied in order for an authorization to apply.
</p>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_require_local ()">
<a name="polkit-authorization-constraint-get-require-local"></a><h3>polkit_authorization_constraint_get_require_local ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_get_require_local
(<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Get a <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> object that represents the
constraint that the session or caller must be local.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the constraint
</td>
</tr></tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_require_active ()">
<a name="polkit-authorization-constraint-get-require-active"></a><h3>polkit_authorization_constraint_get_require_active ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_get_require_active
(<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Get a <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> object that represents the
constraint that the session or caller must be active.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the constraint
</td>
</tr></tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_require_exe ()">
<a name="polkit-authorization-constraint-get-require-exe"></a><h3>polkit_authorization_constraint_get_require_exe ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_get_require_exe
(<em class="parameter"><code>const <span class="type">char</span> *path</code></em>);</pre>
<p>
Get a <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> object that represents the
constraint that the caller must be a specific program
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>path to program
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the constraint or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> on OOM
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_require_selinux_context ()">
<a name="polkit-authorization-constraint-get-require-selinux-context"></a><h3>polkit_authorization_constraint_get_require_selinux_context ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_get_require_selinux_context
(<em class="parameter"><code>const <span class="type">char</span> *context</code></em>);</pre>
<p>
Get a <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> object that represents the
constraint that the caller must be in a specific SELinux context.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td>SELinux context
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the constraint or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> on OOM
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_ref ()">
<a name="polkit-authorization-constraint-ref"></a><h3>polkit_authorization_constraint_ref ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_ref
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Increase reference count.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the object
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_unref ()">
<a name="polkit-authorization-constraint-unref"></a><h3>polkit_authorization_constraint_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> polkit_authorization_constraint_unref
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Decreases the reference count of the object. If it becomes zero,
the object is freed. Before freeing, reference counts on embedded
objects are decresed by one.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the authorization_constraint object
</td>
</tr></tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_debug ()">
<a name="polkit-authorization-constraint-debug"></a><h3>polkit_authorization_constraint_debug ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> polkit_authorization_constraint_debug
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Print debug details
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr></tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_validate ()">
<a name="polkit-authorization-constraint-validate"></a><h3>polkit_authorization_constraint_validate ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> polkit_authorization_constraint_validate
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Validate the object
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> iff the object is valid.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_type ()">
<a name="polkit-authorization-constraint-type"></a><h3>polkit_authorization_constraint_type ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraintType" title="enum PolKitAuthorizationConstraintType"><span class="returnvalue">PolKitAuthorizationConstraintType</span></a> polkit_authorization_constraint_type
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Describe the constraint; this is only useful when inspecting an
authorization to present information to the user (e.g. as
polkit-auth(1) does).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> type from <a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraintType" title="enum PolKitAuthorizationConstraintType"><span class="type">PolKitAuthorizationConstraintType</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_exe ()">
<a name="polkit-authorization-constraint-get-exe"></a><h3>polkit_authorization_constraint_get_exe ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * polkit_authorization_constraint_get_exe
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Get the exe path for the constraint.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The exe path or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if type isn't
<a class="link" href="polkit-Authorization-Constraints.html#POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-EXE:CAPS"><span class="type">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_EXE</span></a>. Caller shall not
free this string.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_selinux_context ()">
<a name="polkit-authorization-constraint-get-selinux-context"></a><h3>polkit_authorization_constraint_get_selinux_context ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * polkit_authorization_constraint_get_selinux_context
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>);</pre>
<p>
Get the SELinux context for the constraint.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The selinux context or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if type isn't
<a class="link" href="polkit-Authorization-Constraints.html#POLKIT-AUTHORIZATION-CONSTRAINT-TYPE-REQUIRE-SELINUX-CONTEXT:CAPS"><span class="type">POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_SELINUX_CONTEXT</span></a>. Caller
shall not free this string.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_check_session ()">
<a name="polkit-authorization-constraint-check-session"></a><h3>polkit_authorization_constraint_check_session ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> polkit_authorization_constraint_check_session
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Session.html#PolKitSession" title="PolKitSession"><span class="type">PolKitSession</span></a> *session</code></em>);</pre>
<p>
Determine if the given session satisfies the conditions imposed by
the given constraint.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td>the session
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> if, and only if, the given session satisfies the
conditions imposed by the given constraint.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_check_caller ()">
<a name="polkit-authorization-constraint-check-caller"></a><h3>polkit_authorization_constraint_check_caller ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> polkit_authorization_constraint_check_caller
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Caller.html#PolKitCaller" title="PolKitCaller"><span class="type">PolKitCaller</span></a> *caller</code></em>);</pre>
<p>
Determine if the given caller satisfies the conditions imposed by
the given constraint
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>caller</code></em> :</span></p></td>
<td>the caller
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> if, and only if, the given caller satisfies the
conditions imposed by the given constraint.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_to_string ()">
<a name="polkit-authorization-constraint-to-string"></a><h3>polkit_authorization_constraint_to_string ()</h3>
<pre class="programlisting"><span class="returnvalue">size_t</span> polkit_authorization_constraint_to_string
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *authc</code></em>,
<em class="parameter"><code><span class="type">char</span> *out_buf</code></em>,
<em class="parameter"><code><span class="type">size_t</span> buf_size</code></em>);</pre>
<p>
Get a textual representation of the constraint; this is only useful
for serializing; it's a machine, not human, readable string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>authc</code></em> :</span></p></td>
<td>the object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_buf</code></em> :</span></p></td>
<td>buffer to store the string representation in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf_size</code></em> :</span></p></td>
<td>size of buffer
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Number of characters written (not including trailing
'\0'). If the output was truncated due to the buffer being too
small, buf_size will be returned. Thus, a return value of buf_size
or more indicates that the output was truncated (see snprintf(3))
or an error occured.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_from_string ()">
<a name="polkit-authorization-constraint-from-string"></a><h3>polkit_authorization_constraint_from_string ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="returnvalue">PolKitAuthorizationConstraint</span></a> * polkit_authorization_constraint_from_string
(<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>
Construct a constraint from a textual representation as returned by
<a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-to-string" title="polkit_authorization_constraint_to_string ()"><code class="function">polkit_authorization_constraint_to_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>textual representation of constraint
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the constraint or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> if the string coulnd't be parsed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_get_from_caller ()">
<a name="polkit-authorization-constraint-get-from-caller"></a><h3>polkit_authorization_constraint_get_from_caller ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> polkit_authorization_constraint_get_from_caller
(<em class="parameter"><code><a class="link" href="polkit-Caller.html#PolKitCaller" title="PolKitCaller"><span class="type">PolKitCaller</span></a> *caller</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> **out_array</code></em>,
<em class="parameter"><code><span class="type">size_t</span> array_size</code></em>);</pre>
<p>
Given a caller, return the set of most restrictive constraints
possible. For example, if the caller is local and active, a set
constraints requiring this will be returned.
</p>
<p>
This function is typically used when the caller obtains an
authorization through authentication; the goal is to put
constraints on the authorization such that it's only valid when the
caller is in the context as where she obtained it.
</p>
<p>
The caller must unref all the created objects using
<a class="link" href="polkit-Authorization-Constraints.html#polkit-authorization-constraint-unref" title="polkit_authorization_constraint_unref ()"><code class="function">polkit_authorization_constraint_unref()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>caller</code></em> :</span></p></td>
<td>caller
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_array</code></em> :</span></p></td>
<td>return location for constraints
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>array_size</code></em> :</span></p></td>
<td>size of the passed array
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> If OOM -1 is returned. This function do not create more
than <em class="parameter"><code>array_size</code></em> constraints (including the trailing <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). If the
output was truncated due to this limit then the return value is the
number of objects (not including the trailing <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) which would
have been written to the final array if enough space had been
available. Thus, a return value of <em class="parameter"><code>array_size</code></em> or more means that
the output was truncated.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
<hr>
<div class="refsect2" title="polkit_authorization_constraint_equal ()">
<a name="polkit-authorization-constraint-equal"></a><h3>polkit_authorization_constraint_equal ()</h3>
<pre class="programlisting"><a class="link" href="polkit-Basic-types.html#polkit-bool-t" title="polkit_bool_t"><span class="returnvalue">polkit_bool_t</span></a> polkit_authorization_constraint_equal
(<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *a</code></em>,
<em class="parameter"><code><a class="link" href="polkit-Authorization-Constraints.html#PolKitAuthorizationConstraint" title="PolKitAuthorizationConstraint"><span class="type">PolKitAuthorizationConstraint</span></a> *b</code></em>);</pre>
<p>
Determines if two constraints are equal
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
<td>first constraint
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
<td>first constraint
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> only if the given constraints are equal
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.14</div>
</body>
</html>
ACC SHELL 2018