Polkit.AuthorizationResult¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Polkit.AuthorizationResult(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This class represents the result you get when checking for an authorization.
- classmethod new(is_authorized, is_challenge, details)¶
- Parameters:
- Returns:
A
Polkit.AuthorizationResult
object. Free withGObject.Object.unref
().- Return type:
Creates a new
Polkit.AuthorizationResult
object.
- get_details()¶
- Returns:
A
Polkit.Details
object orNone
if there are no details. This object is owned by self and should not be freed by the caller.- Return type:
Gets the details about the result.
- get_dismissed()¶
-
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
.New in version 0.101.
- get_is_authorized()¶
- Returns:
Whether the subject is authorized.
- Return type:
Gets whether the subject is authorized.
If the authorization is temporary, use
Polkit.AuthorizationResult.get_temporary_authorization_id
() to get the opaque identifier for the temporary authorization.
- get_is_challenge()¶
- Returns:
Whether the subject is authorized if more information is provided.
- Return type:
Gets whether the subject is authorized if more information is provided.
- get_retains_authorization()¶
-
Gets whether authorization is retained if obtained via authentication. This can only be the case if self indicates that the subject can obtain authorization after challenge (cf.
Polkit.AuthorizationResult.get_is_challenge
()), e.g. when the subject is not already authorized (cf.Polkit.AuthorizationResult.get_is_authorized
()).If the subject is already authorized, use
Polkit.AuthorizationResult.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
.
- get_temporary_authorization_id()¶
- Returns:
The opaque temporary authorization id for self or
None
if not available. Do not free this string, it is owned by self.- Return type:
Gets the opaque temporary authorization id for self if self 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 orPolkit.Authority.revoke_temporary_authorization_by_id
() to revoke the temporary authorization.If the subject is not authorized, use
Polkit.AuthorizationResult.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
.