Top |
PolkitAuthorizationResult * polkit_authorization_result_new (gboolean is_authorized
,gboolean is_challenge
,PolkitDetails *details
);
Creates a new PolkitAuthorizationResult object.
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.
gboolean
polkit_authorization_result_get_is_challenge
(PolkitAuthorizationResult *result
);
Gets whether the subject is authorized if more information is provided.
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
.
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
.
The opaque temporary authorization id for
result
or NULL
if not available. Do not free this string, it
is owned by result
.
[allow-none]
gboolean
polkit_authorization_result_get_dismissed
(PolkitAuthorizationResult *result
);
Gets whether the authentication request was dismissed / canceled by the user.
This method simply reads the value of the key/value pair in details
with the
key polkit.dismissed
.
Since: 0.101
PolkitDetails *
polkit_authorization_result_get_details
(PolkitAuthorizationResult *result
);
Gets the details about the result.
A PolkitDetails object or
NULL
if there are no details. This object is owned by result
and
should not be freed by the caller.
[allow-none][transfer none]
typedef struct _PolkitAuthorizationResult PolkitAuthorizationResult;
The PolkitAuthorizationResult struct should not be accessed directly.