# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=
-MAINTAINERCLEANFILES = \
- *~ \
- Makefile.in \
- polkitbackend.types \
- polkit-*.txt \
+MAINTAINERCLEANFILES = \
+ *~ \
+ Makefile.in \
+ polkitbackend-decl-list.txt \
+ polkitbackend-decl.txt \
+ polkitbackend-overrides.txt \
+ polkitbackend-undeclared.txt \
+ polkitbackend-undocumented.txt \
$(NULL)
if ENABLE_GTK_DOC
CLEANFILES += *~ \
polkitbackend-scan.* \
- polkitbackend.* \
+ polkitbackend.args \
+ polkitbackend.hierarchy \
+ polkitbackend.interfaces \
+ polkitbackend.prerequisites \
+ polkitbackend.signals \
*.bak \
polkitbackend-decl-list.txt \
polkitbackend-decl.txt \
polkitbackend-overrides.txt \
polkitbackend-undeclared.txt \
polkitbackend-undocumented.txt \
- polkitbackend-sections.txt \
*.stamp \
-rf html xml \
$(NULL)
--- /dev/null
+<SECTION>
+<FILE>polkitbackendauthority</FILE>
+<TITLE>PolkitBackendAuthority</TITLE>
+PolkitBackendAuthority
+PolkitBackendAuthorityClass
+polkit_backend_authority_check_authorization
+polkit_backend_authority_check_authorization_finish
+polkit_backend_authority_register_authentication_agent
+polkit_backend_authority_unregister_authentication_agent
+polkit_backend_authority_authentication_agent_response
+polkit_backend_authority_enumerate_actions
+polkit_backend_authority_enumerate_users
+polkit_backend_authority_enumerate_groups
+polkit_backend_authority_enumerate_authorizations
+polkit_backend_authority_add_authorization
+polkit_backend_authority_remove_authorization
+polkit_backend_authority_system_bus_name_owner_changed
+polkit_backend_register_authority
+<SUBSECTION Standard>
+POLKIT_BACKEND_AUTHORITY
+POLKIT_BACKEND_IS_AUTHORITY
+POLKIT_BACKEND_TYPE_AUTHORITY
+polkit_backend_authority_get_type
+POLKIT_BACKEND_AUTHORITY_CLASS
+POLKIT_BACKEND_IS_AUTHORITY_CLASS
+POLKIT_BACKEND_AUTHORITY_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitbackendlocalauthority</FILE>
+<TITLE>PolkitBackendLocalAuthority</TITLE>
+PolkitBackendLocalAuthority
+PolkitBackendLocalAuthorityClass
+polkit_backend_local_authority_new
+<SUBSECTION Standard>
+POLKIT_BACKEND_LOCAL_AUTHORITY
+POLKIT_BACKEND_IS_LOCAL_AUTHORITY
+POLKIT_BACKEND_TYPE_LOCAL_AUTHORITY
+polkit_backend_local_authority_get_type
+POLKIT_BACKEND_LOCAL_AUTHORITY_CLASS
+POLKIT_BACKEND_IS_LOCAL_AUTHORITY_CLASS
+POLKIT_BACKEND_LOCAL_AUTHORITY_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitbackendactionpool</FILE>
+<TITLE>PolkitBackendActionPool</TITLE>
+PolkitBackendActionPool
+polkit_backend_action_pool_new
+polkit_backend_action_pool_get_all_actions
+polkit_backend_action_pool_get_action
+<SUBSECTION Standard>
+POLKIT_BACKEND_ACTION_POOL
+POLKIT_BACKEND_IS_ACTION_POOL
+POLKIT_BACKEND_TYPE_ACTION_POOL
+polkit_backend_action_pool_get_type
+POLKIT_BACKEND_ACTION_POOL_CLASS
+POLKIT_BACKEND_IS_ACTION_POOL_CLASS
+POLKIT_BACKEND_ACTION_POOL_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitbackendsessionmonitor</FILE>
+PolkitBackendSessionMonitor
+polkit_backend_session_monitor_new
+polkit_backend_session_monitor_get_sessions
+polkit_backend_session_monitor_get_user_for_subject
+polkit_backend_session_monitor_get_session_for_subject
+polkit_backend_session_monitor_is_session_local
+polkit_backend_session_monitor_is_session_active
+<SUBSECTION Standard>
+POLKIT_BACKEND_SESSION_MONITOR
+POLKIT_BACKEND_IS_SESSION_MONITOR
+POLKIT_BACKEND_TYPE_SESSION_MONITOR
+polkit_backend_session_monitor_get_type
+POLKIT_BACKEND_SESSION_MONITOR_CLASS
+POLKIT_BACKEND_IS_SESSION_MONITOR_CLASS
+POLKIT_BACKEND_SESSION_MONITOR_GET_CLASS
+</SECTION>
--- /dev/null
+polkit_backend_authority_get_type
+polkit_backend_local_authority_get_type
+polkit_backend_action_pool_get_type
+polkit_backend_session_monitor_get_type
*
* Finishes retrieving all registered actions.
*
- * Returns: A list of #PolkitActionDescription or %NULL if @error is set. The returned list
+ * Returns: A list of #PolkitActionDescription objects or %NULL if @error is set. The returned list
* should be freed with g_list_free() after each element have been freed with g_object_unref().
**/
GList *
#include "polkitbackendprivate.h"
+/**
+ * SECTION:polkitbackendauthority
+ * @title: PolkitBackendAuthority
+ * @short_description: Abstract base class for authority backends
+ * @stability: Unstable
+ * @see_also: PolkitBackendLocalAuthority
+ *
+ * To implement an authority backend, simply subclass #PolkitBackendAuthority
+ * and implement the required VFuncs.
+ */
+
enum
{
CHANGED_SIGNAL,
* PolkitBackendAuthority::changed:
* @authority: A #PolkitBackendAuthority.
*
- * Emitted when actions and/or authorizations change
+ * Emitted when actions and/or authorizations change.
*/
signals[CHANGED_SIGNAL] = g_signal_new ("changed",
POLKIT_BACKEND_TYPE_AUTHORITY,
klass->system_bus_name_owner_changed (authority, name, old_owner, new_owner);
}
+/**
+ * polkit_backend_authority_enumerate_actions:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @locale: The locale to retrieve descriptions for.
+ * @error: Return location for error or %NULL.
+ *
+ * Retrieves all registered actions.
+ *
+ * Returns: A list of #PolkitActionDescription objects or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
GList *
polkit_backend_authority_enumerate_actions (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *locale,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->enumerate_actions (authority, caller, locale, cancellable, error);
+ if (klass->enumerate_actions == NULL)
+ {
+ g_warning ("enumerate_actions is not implemented (it is not optional)");
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported (bug in backend)");
+ return NULL;
+ }
+ else
+ {
+ return klass->enumerate_actions (authority, caller, locale, error);
+ }
}
+/**
+ * polkit_backend_authority_enumerate_users:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @error: Return location for error or %NULL.
+ *
+ * Enumerates all users known by @authority.
+ *
+ * Returns: A list of #PolkitIdentity objects or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
GList *
polkit_backend_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->enumerate_users (authority, caller, cancellable, error);
+ if (klass->enumerate_users == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return NULL;
+ }
+ else
+ {
+ return klass->enumerate_users (authority, caller, error);
+ }
}
+/**
+ * polkit_backend_authority_enumerate_groups:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @error: Return location for error or %NULL.
+ *
+ * Enumerates all groups known by @authority.
+ *
+ * Returns: A list of #PolkitIdentity objects or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
GList *
polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->enumerate_groups (authority, caller, cancellable, error);
+ if (klass->enumerate_groups == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return NULL;
+ }
+ else
+ {
+ return klass->enumerate_groups (authority, caller, error);
+ }
}
+/**
+ * polkit_backend_authority_check_authorization:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @subject: A #PolkitSubject.
+ * @action_id: The action to check for.
+ * @flags: A set of #PolkitCheckAuthorizationFlags.
+ * @cancellable: A #GCancellable.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously checks if @subject is authorized to perform the action represented
+ * by @action_id.
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_backend_authority_check_authorization_finish() to get the result of
+ * the operation.
+ **/
void
polkit_backend_authority_check_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- klass->check_authorization (authority, caller, subject, action_id, flags, cancellable, callback, user_data);
+ if (klass->check_authorization == NULL)
+ {
+ GSimpleAsyncResult *simple;
+
+ g_warning ("check_authorization is not implemented (it is not optional)");
+
+ simple = g_simple_async_result_new_error (G_OBJECT (authority),
+ callback,
+ user_data,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported (bug in backend)");
+ g_simple_async_result_complete (simple);
+ g_object_unref (simple);
+ }
+ else
+ {
+ klass->check_authorization (authority, caller, subject, action_id, flags, cancellable, callback, user_data);
+ }
}
+/**
+ * polkit_backend_authority_check_authorization_finish:
+ * @authority: A #PolkitBackendAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes checking if a subject is authorized for an action.
+ *
+ * Returns: A #PolkitAuthorizationResult.
+ **/
PolkitAuthorizationResult
polkit_backend_authority_check_authorization_finish (PolkitBackendAuthority *authority,
GAsyncResult *res,
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->check_authorization_finish (authority, res, error);
+ if (klass->check_authorization_finish == NULL)
+ {
+ g_warning ("check_authorization_finish is not implemented (it is not optional)");
+ g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+ return POLKIT_AUTHORIZATION_RESULT_NOT_AUTHORIZED;
+ }
+ else
+ {
+ return klass->check_authorization_finish (authority, res, error);
+ }
}
+/**
+ * polkit_backend_authority_enumerate_authorizations:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @identity: The identity to retrieve authorizations from.
+ * @error: Return location for error or %NULL.
+ *
+ * Retrieves all authorizations for @identity.
+ *
+ * Returns: A list of #PolkitAuthorization objects or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
GList *
polkit_backend_authority_enumerate_authorizations (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->enumerate_authorizations (authority, caller, identity, cancellable, error);
+ if (klass->enumerate_authorizations == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return NULL;
+ }
+ else
+ {
+ return klass->enumerate_authorizations (authority, caller, identity, error);
+ }
}
+/**
+ * polkit_backend_authority_add_authorization:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @identity: The identity to add @authorization to.
+ * @authorization: The authorization to add.
+ * @error: Return location for error or %NULL.
+ *
+ * Adds @authorization to @identity.
+ *
+ * Returns: %TRUE if the operation succeeded or %FALSE if @error is set.
+ **/
gboolean
polkit_backend_authority_add_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->add_authorization (authority, caller, identity, authorization, cancellable, error);
+ if (klass->add_authorization == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return FALSE;
+ }
+ else
+ {
+ return klass->add_authorization (authority, caller, identity, authorization, error);
+ }
}
+/**
+ * polkit_backend_authority_remove_authorization:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @identity: The identity to remove @authorization from.
+ * @authorization: The authorization to remove.
+ * @error: Return location for error or %NULL.
+ *
+ * Removes @authorization from @identity.
+ *
+ * Returns: %TRUE if the operation succeeded or %FALSE if @error is set.
+ **/
gboolean
polkit_backend_authority_remove_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->remove_authorization (authority, caller, identity, authorization, cancellable, error);
+ if (klass->remove_authorization == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return FALSE;
+ }
+ else
+ {
+ return klass->remove_authorization (authority, caller, identity, authorization, error);
+ }
}
+/**
+ * polkit_backend_authority_register_authentication_agent:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @object_path: The object path for the authentication agent.
+ * @error: Return location for error or %NULL.
+ *
+ * Registers an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully registered, %FALSE if @error is set.
+ **/
gboolean
polkit_backend_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->register_authentication_agent (authority, caller, object_path, cancellable, error);
+ if (klass->register_authentication_agent == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return FALSE;
+ }
+ else
+ {
+ return klass->register_authentication_agent (authority, caller, object_path, error);
+ }
}
+/**
+ * polkit_backend_authority_unregister_authentication_agent:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @object_path: The object path that the authentication agent is registered at.
+ * @error: Return location for error or %NULL.
+ *
+ * Unregisters an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully unregistered, %FALSE if @error is set.
+ **/
gboolean
polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->unregister_authentication_agent (authority, caller, object_path, cancellable, error);
+ if (klass->unregister_authentication_agent == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return FALSE;
+ }
+ else
+ {
+ return klass->unregister_authentication_agent (authority, caller, object_path, error);
+ }
}
+/**
+ * polkit_backend_authority_authentication_agent_response:
+ * @authority: A #PolkitBackendAuthority.
+ * @caller: The system bus name that initiated the query.
+ * @cookie: The cookie passed to the authentication agent from the authority.
+ * @identity: The identity that was authenticated.
+ * @error: Return location for error or %NULL.
+ *
+ * Provide response that @identity successfully authenticated for the
+ * authentication request identified by @cookie.
+ *
+ * Returns: %TRUE if @authority acknowledged the call, %FALSE if @error is set.
+ **/
gboolean
polkit_backend_authority_authentication_agent_response (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *cookie,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
- return klass->authentication_agent_response (authority, caller, cookie, identity, cancellable, error);
+ if (klass->authentication_agent_response == NULL)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_NOT_SUPPORTED,
+ "Operation not supported");
+ return FALSE;
+ }
+ else
+ {
+ return klass->authentication_agent_response (authority, caller, cookie, identity, error);
+ }
}
/* ---------------------------------------------------------------------------------------------------- */
actions = polkit_backend_authority_enumerate_actions (server->authority,
caller,
locale,
- NULL,
&error);
if (error != NULL)
{
identities = polkit_backend_authority_enumerate_users (server->authority,
caller,
- NULL,
&error);
if (error != NULL)
{
identities = polkit_backend_authority_enumerate_groups (server->authority,
caller,
- NULL,
&error);
if (error != NULL)
{
authorizations = polkit_backend_authority_enumerate_authorizations (server->authority,
caller,
identity,
- NULL,
&error);
if (error != NULL)
caller,
identity,
authorization,
- NULL,
&error))
{
egg_dbus_method_invocation_return_gerror (method_invocation, error);
caller,
identity,
authorization,
- NULL,
&error))
{
egg_dbus_method_invocation_return_gerror (method_invocation, error);
if (!polkit_backend_authority_register_authentication_agent (server->authority,
caller,
object_path,
- NULL,
&error))
{
egg_dbus_method_invocation_return_gerror (method_invocation, error);
if (!polkit_backend_authority_unregister_authentication_agent (server->authority,
caller,
object_path,
- NULL,
&error))
{
egg_dbus_method_invocation_return_gerror (method_invocation, error);
caller,
cookie,
identity,
- NULL,
&error))
{
egg_dbus_method_invocation_return_gerror (method_invocation, error);
typedef struct _PolkitBackendAuthorityClass PolkitBackendAuthorityClass;
+/**
+ * PolkitBackendAuthority:
+ *
+ * The #PolkitBackendAuthority struct should not be accessed directly.
+ */
struct _PolkitBackendAuthority
{
GObject parent_instance;
};
+/**
+ * PolkitBackendAuthorityClass:
+ * @parent_class: The parent class.
+ * @changed: Function pointer for #PolkitBackendAuthorityClass::changed signal.
+ * @enumerate_actions: Enumerates registered actions on the
+ * system. See polkit_backend_authority_enumerate_actions() for
+ * details.
+ * @check_authorization: Called to initiate an asynchronous
+ * authorization check. See
+ * polkit_backend_authority_check_authorization() for details.
+ * @check_authorization_finish: Called when finishing an authorization
+ * check. See polkit_backend_authority_check_authorization_finish()
+ * for details.
+ * @register_authentication_agent: Called when an authentication agent
+ * is attempting to register or %NULL if the backend doesn't support
+ * the operation. See
+ * polkit_backend_authority_register_authentication_agent() for
+ * details.
+ * @unregister_authentication_agent: Called when an authentication
+ * agent is attempting to unregister or %NULL if the backend doesn't
+ * support the operation. See
+ * polkit_backend_authority_unregister_authentication_agent() for
+ * details.
+ * @authentication_agent_response: Called by an authentication agent
+ * when the user successfully authenticates or %NULL if the backend
+ * doesn't support the operation. See
+ * polkit_backend_authority_authentication_agent_response() for
+ * details.
+ * @enumerate_users: Enumerates users on the system or %NULL if the
+ * backend doesn't support the operation. See
+ * polkit_backend_authority_enumerate_users() for details.
+ * @enumerate_groups: Enumerates groups on the system or %NULL if the
+ * backend doesn't support the operation. See
+ * polkit_backend_authority_enumerate_groups() for details.
+ * @enumerate_authorizations: Enumerates authorizations for a given
+ * identity or %NULL if the backend doesn't support the operation. See
+ * polkit_backend_authority_enumerate_authorizations() for details.
+ * @add_authorization: Add an authorization to a given identity or
+ * %NULL if the backend doesn't support the operation. See
+ * polkit_backend_authority_add_authorization() for details.
+ * @remove_authorization: Remove an authorization for a given identity
+ * or %NULL if the backend doesn't support the operation. See
+ * polkit_backend_authority_remove_authorization() for details.
+ * @system_bus_name_owner_changed: temporary VFunc, to be removed before 1.0.
+ *
+ * VFuncs that authority backends need to implement.
+ */
struct _PolkitBackendAuthorityClass
{
- GObjectClass parent_class;
-
/*< public >*/
+ GObjectClass parent_class;
/* Signals */
void (*changed) (PolkitBackendAuthority *authority);
/* VTable */
- /* TODO: need something more efficient such that we don't watch all name changes */
- void (*system_bus_name_owner_changed) (PolkitBackendAuthority *authority,
- const gchar *name,
- const gchar *old_owner,
- const gchar *new_owner);
-
GList *(*enumerate_actions) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *locale,
- GCancellable *cancellable,
- GError **error);
-
- GList *(*enumerate_users) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- GCancellable *cancellable,
- GError **error);
-
- GList *(*enumerate_groups) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- GCancellable *cancellable,
GError **error);
void (*check_authorization) (PolkitBackendAuthority *authority,
GAsyncResult *res,
GError **error);
+ gboolean (*register_authentication_agent) (PolkitBackendAuthority *authority,
+ PolkitSubject *caller,
+ const gchar *object_path,
+ GError **error);
+
+ gboolean (*unregister_authentication_agent) (PolkitBackendAuthority *authority,
+ PolkitSubject *caller,
+ const gchar *object_path,
+ GError **error);
+
+ gboolean (*authentication_agent_response) (PolkitBackendAuthority *authority,
+ PolkitSubject *caller,
+ const gchar *cookie,
+ PolkitIdentity *identity,
+ GError **error);
+
+ GList *(*enumerate_users) (PolkitBackendAuthority *authority,
+ PolkitSubject *caller,
+ GError **error);
+
+ GList *(*enumerate_groups) (PolkitBackendAuthority *authority,
+ PolkitSubject *caller,
+ GError **error);
+
GList *(*enumerate_authorizations) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error);
gboolean (*add_authorization) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
gboolean (*remove_authorization) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
- gboolean (*register_authentication_agent) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error);
-
- gboolean (*unregister_authentication_agent) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error);
-
- gboolean (*authentication_agent_response) (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- const gchar *cookie,
- PolkitIdentity *identity,
- GCancellable *cancellable,
- GError **error);
+ /* TODO: need something more efficient such that we don't watch all name changes */
+ void (*system_bus_name_owner_changed) (PolkitBackendAuthority *authority,
+ const gchar *name,
+ const gchar *old_owner,
+ const gchar *new_owner);
/*< private >*/
/* Padding for future expansion */
GList *polkit_backend_authority_enumerate_actions (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *locale,
- GCancellable *cancellable,
GError **error);
GList *polkit_backend_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error);
GList *polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error);
void polkit_backend_authority_check_authorization (PolkitBackendAuthority *authority,
GList *polkit_backend_authority_enumerate_authorizations (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error);
gboolean polkit_backend_authority_add_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
gboolean polkit_backend_authority_remove_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
gboolean polkit_backend_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error);
gboolean polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error);
gboolean polkit_backend_authority_authentication_agent_response (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *cookie,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error);
/* --- */
G_END_DECLS
#endif /* __POLKIT_BACKEND_AUTHORITY_H */
-
#include "_polkitagentbindings.h"
#include <polkit/polkitprivate.h>
+/**
+ * SECTION:polkitbackendlocalauthority
+ * @title: PolkitBackendLocalAuthority
+ * @short_description: Local Authority
+ * @stability: Unstable
+ *
+ * An implementation of #PolkitBackendAuthority that stores authorizations on the local file system
+ * and supports interaction with authentication agents.
+ */
typedef struct
{
static GList *polkit_backend_local_authority_enumerate_actions (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *locale,
- GCancellable *cancellable,
GError **error);
static GList *polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error);
static GList *polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error);
static void polkit_backend_local_authority_check_authorization (PolkitBackendAuthority *authority,
static GList *polkit_backend_local_authority_enumerate_authorizations (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error);
static gboolean polkit_backend_local_authority_add_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
static gboolean polkit_backend_local_authority_remove_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error);
static gboolean polkit_backend_local_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error);
static gboolean polkit_backend_local_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error);
static gboolean polkit_backend_local_authority_authentication_agent_response (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *cookie,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error);
/* ---------------------------------------------------------------------------------------------------- */
polkit_backend_local_authority_enumerate_actions (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *locale,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
static GList *
polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
static GList *
polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitSubject *caller,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
polkit_backend_local_authority_enumerate_authorizations (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
polkit_backend_local_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
polkit_backend_local_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *object_path,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
PolkitSubject *caller,
const gchar *cookie,
PolkitIdentity *identity,
- GCancellable *cancellable,
GError **error)
{
PolkitBackendLocalAuthority *local_authority;
#define POLKIT_BACKEND_IS_LOCAL_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_BACKEND_TYPE_LOCAL_AUTHORITY))
#define POLKIT_BACKEND_IS_LOCAL_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_BACKEND_TYPE_LOCAL_AUTHORITY))
-#if 0
-typedef struct _PolkitBackendLocalAuthority PolkitBackendLocalAuthority;
-#endif
-
typedef struct _PolkitBackendLocalAuthorityClass PolkitBackendLocalAuthorityClass;
+/**
+ * PolkitBackendLocalAuthority:
+ *
+ * The #PolkitBackendLocalAuthority struct should not be accessed directly.
+ */
struct _PolkitBackendLocalAuthority
{
+ /*< private >*/
PolkitBackendAuthority parent_instance;
};
+/**
+ * PolkitBackendLocalAuthorityClass:
+ * @parent_class: The parent class.
+ *
+ * Class structure for #PolkitBackendLocalAuthority.
+ */
struct _PolkitBackendLocalAuthorityClass
{
- PolkitBackendAuthorityClass parent_class;
-
/*< public >*/
+ PolkitBackendAuthorityClass parent_class;
/*< private >*/
/* Padding for future expansion */