manpagez: man pages & more
html files: polkit
Home | html | info | man

PolkitAuthorizationResult

PolkitAuthorizationResult — Result for checking an authorization

Stability Level

Stable, unless otherwise indicated

Object Hierarchy

  GObject
   +----PolkitAuthorizationResult

Description

This class represents the result you get when checking for an authorization.

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.

is_authorized :

Whether the subject is authorized.

is_challenge :

Whether the subject is authorized if more information is provided. Must be FALSE unless is_authorized is TRUE.

details :

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.

result :

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.

result :

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.

result :

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.

result :

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.

result :

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.

result :

A PolkitAuthorizationResult.

Returns :

A PolkitDetails object. This object is owned by result and should not be freed by the caller.
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.