PolkitBackendInteractiveAuthority

## PolkitBackendInteractiveAuthority PolkitBackendInteractiveAuthority — Interactive Authority |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

                        PolkitBackendInteractiveAuthority;
    struct              PolkitBackendInteractiveAuthorityClass;
    GList *             polkit_backend_interactive_authority_get_admin_identities
                                                            (PolkitBackendInteractiveAuthority *authority,
                                                             PolkitSubject *caller,
                                                             PolkitSubject *subject,
                                                             PolkitIdentity *user_for_subject,
                                                             const gchar *action_id,
                                                             PolkitDetails *details);
    PolkitImplicitAuthorization polkit_backend_interactive_authority_check_authorization_sync
                                                            (PolkitBackendInteractiveAuthority *authority,
                                                             PolkitSubject *caller,
                                                             PolkitSubject *subject,
                                                             PolkitIdentity *user_for_subject,
                                                             gboolean subject_is_local,
                                                             gboolean subject_is_active,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitImplicitAuthorization implicit,
                                                             PolkitDetails *out_details);

## Object Hierarchy

      GObject
       +----PolkitBackendAuthority
             +----PolkitBackendInteractiveAuthority
                   +----PolkitBackendLocalAuthority

## Description

An subclass of PolkitBackendAuthority that supports interaction with authentication agents.

## Details

### PolkitBackendInteractiveAuthority

    typedef struct _PolkitBackendInteractiveAuthority PolkitBackendInteractiveAuthority;

The PolkitBackendInteractiveAuthority struct should not be accessed directly.

### struct PolkitBackendInteractiveAuthorityClass

    struct PolkitBackendInteractiveAuthorityClass {
      PolkitBackendAuthorityClass parent_class;

      /* VTable */
      GList *                     (*get_admin_identities)          (PolkitBackendInteractiveAuthority *authority,
                                                                    PolkitSubject                     *caller,
                                                                    PolkitSubject                     *subject,
                                                                    PolkitIdentity                    *user_for_subject,
                                                                    const gchar                       *action_id,
                                                                    PolkitDetails                     *details);

      PolkitImplicitAuthorization (*check_authorization_sync) (PolkitBackendInteractiveAuthority *authority,
                                                               PolkitSubject                     *caller,
                                                               PolkitSubject                     *subject,
                                                               PolkitIdentity                    *user_for_subject,
                                                               gboolean                           subject_is_local,
                                                               gboolean                           subject_is_active,
                                                               const gchar                       *action_id,
                                                               PolkitDetails                     *details,
                                                               PolkitImplicitAuthorization        implicit,
                                                               PolkitDetails                     *out_details);
    };

Class structure for PolkitBackendInteractiveAuthority.

PolkitBackendAuthorityClass `parent_class`; | The parent class.
`get_admin_identities` () | Returns list of identities for administrator authentication or `NULL` to use the default implementation. See `polkit_backend_interactive_authority_get_admin_identities()` for details.
`check_authorization_sync` () | Checks for an authorization or `NULL` to use the default implementation. See `polkit_backend_interactive_authority_check_authorization_sync()` for details.

### polkit_backend_interactive_authority_get_admin_identities ()

    GList *             polkit_backend_interactive_authority_get_admin_identities
                                                            (PolkitBackendInteractiveAuthority *authority,
                                                             PolkitSubject *caller,
                                                             PolkitSubject *subject,
                                                             PolkitIdentity *user_for_subject,
                                                             const gchar *action_id,
                                                             PolkitDetails *details);

Gets a list of identities to use for administrator authentication.

The default implementation returns a list with a single element for the super user.

`authority` : | A PolkitBackendInteractiveAuthority.
`caller` : | The subject that is inquiring whether `subject` is authorized.
`subject` : | The subject we are about to authenticate for.
`user_for_subject` : | The user of the subject we are about to authenticate for.
`action_id` : | The action we are about to authenticate for.
`details` : | Details about the action.
Returns : | A list of PolkitIdentity objects. Free each element `g_object_unref()`, then free the list with `g_list_free()`.

### polkit_backend_interactive_authority_check_authorization_sync ()

    PolkitImplicitAuthorization polkit_backend_interactive_authority_check_authorization_sync
                                                            (PolkitBackendInteractiveAuthority *authority,
                                                             PolkitSubject *caller,
                                                             PolkitSubject *subject,
                                                             PolkitIdentity *user_for_subject,
                                                             gboolean subject_is_local,
                                                             gboolean subject_is_active,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitImplicitAuthorization implicit,
                                                             PolkitDetails *out_details);

Checks whether `subject` is authorized to perform the action specified by `action_id` and `details`. The implementation may append key/value pairs to `out_details` to return extra information to `caller`.

The default implementation of this method simply returns `implicit`.

`authority` : | A PolkitBackendInteractiveAuthority.
`caller` : | The subject that is inquiring whether `subject` is authorized.
`subject` : | The subject we are checking an authorization for.
`user_for_subject` : | The user of the subject we are checking an authorization for.
`subject_is_local` : | `TRUE` if the session for `subject` is local.
`subject_is_active` : | `TRUE` if the session for `subject` is active.
`action_id` : | The action we are checking an authorization for.
`details` : | Details about the action.
`implicit` : | A PolkitImplicitAuthorization value computed from the policy file and `subject`.
`out_details` : | A PolkitDetails object that will be return to `caller`.
Returns : | A PolkitImplicitAuthorization that specifies if the subject is authorized or whether authentication is required.