PolicyKit Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
Synopsis
PolkitAuthorizationResult; PolkitAuthorizationResult * polkit_authorization_result_new (gboolean is_authorized, gboolean is_challenge, PolkitDetails *details); gboolean polkit_authorization_result_get_is_authorized (PolkitAuthorizationResult *result); gboolean polkit_authorization_result_get_is_challenge (PolkitAuthorizationResult *result); gboolean polkit_authorization_result_get_retains_authorization (PolkitAuthorizationResult *result); const gchar * polkit_authorization_result_get_temporary_authorization_id (PolkitAuthorizationResult *result); gboolean polkit_authorization_result_get_locked_down (PolkitAuthorizationResult *result); PolkitDetails * polkit_authorization_result_get_details (PolkitAuthorizationResult *result);
Details
PolkitAuthorizationResult
typedef struct _PolkitAuthorizationResult PolkitAuthorizationResult;
The PolkitAuthorizationResult struct should not be accessed directly.
polkit_authorization_result_new ()
PolkitAuthorizationResult * polkit_authorization_result_new (gboolean is_authorized, gboolean is_challenge, PolkitDetails *details);
Creates a new PolkitAuthorizationResult object.
|
Whether the subject is authorized. |
|
Whether the subject is authorized if more
information is provided. Must be FALSE unless is_authorized is
TRUE .
|
|
Must be NULL unless is_authorized is TRUE
|
Returns : |
A PolkitAuthorizationResult object. Free with g_object_unref() .
|
polkit_authorization_result_get_is_authorized ()
gboolean polkit_authorization_result_get_is_authorized (PolkitAuthorizationResult *result);
Gets whether the subject is authorized.
If the authorization is temporary, use polkit_authorization_result_get_temporary_authorization_id()
to get the opaque identifier for the temporary authorization.
|
A PolkitAuthorizationResult. |
Returns : |
Whether the subject is authorized. |
polkit_authorization_result_get_is_challenge ()
gboolean polkit_authorization_result_get_is_challenge (PolkitAuthorizationResult *result);
Gets whether the subject is authorized if more information is provided.
|
A PolkitAuthorizationResult. |
Returns : |
Whether the subject is authorized if more information is provided. |
polkit_authorization_result_get_retains_authorization ()
gboolean polkit_authorization_result_get_retains_authorization (PolkitAuthorizationResult *result);
Gets whether authorization is retained if obtained via authentication. This can only be the case
if result
indicates that the subject can obtain authorization after challenge (cf.
polkit_authorization_result_get_is_challenge()
), e.g. when the subject is not already authorized (cf.
polkit_authorization_result_get_is_authorized()
).
If the subject is already authorized, use polkit_authorization_result_get_temporary_authorization_id()
to check if the authorization is temporary.
This method simply reads the value of the key/value pair in details
with the
key polkit.retains_authorization_after_challenge
.
|
A PolkitAuthorizationResult. |
Returns : |
TRUE if the authorization is or will be temporary.
|
polkit_authorization_result_get_temporary_authorization_id ()
const gchar * polkit_authorization_result_get_temporary_authorization_id (PolkitAuthorizationResult *result);
Gets the opaque temporary authorization id for result
if result
indicates the
subject is authorized and the authorization is temporary rather than one-shot or
permanent.
You can use this string together with the result from
polkit_authority_enumerate_temporary_authorizations()
to get more details
about the temporary authorization or polkit_authority_revoke_temporary_authorization_by_id()
to revoke the temporary authorization.
If the subject is not authorized, use polkit_authorization_result_get_retains_authorization()
to check if the authorization will be retained if obtained via authentication.
This method simply reads the value of the key/value pair in details
with the
key polkit.temporary_authorization_id
.
|
A PolkitAuthorizationResult. |
Returns : |
The opaque temporary authorization id for result or NULL if not
available. Do not free this string, it is owned by result .
|
polkit_authorization_result_get_locked_down ()
gboolean polkit_authorization_result_get_locked_down (PolkitAuthorizationResult *result);
Gets whether the action is locked down via
e.g. polkit_authority_add_lockdown_for_action()
.
This method simply reads the value of the key/value pair in details
with the
key polkit.lockdown
.
|
A PolkitAuthorizationResult. |
Returns : |
TRUE if the action for the authorization is locked down.
|
polkit_authorization_result_get_details ()
PolkitDetails * polkit_authorization_result_get_details (PolkitAuthorizationResult *result);
Gets the details about the result.
|
A PolkitAuthorizationResult. |
Returns : |
A PolkitDetails object. This object is owned by result
and should not be freed by the caller.
|