Commit 796bfa1d authored by David Zeuthen's avatar David Zeuthen

add PolkitUnixSession and associcated functions

parent 19eb8a92
......@@ -84,16 +84,28 @@
<interface name="org.freedesktop.PolicyKit1.Authority">
<method name="EnumerateUsers">
<arg name="users" direction="out" type="a(sa{sv})"/>
<arg name="users" direction="out" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.StructType" value="Subject"/>
</arg>
</method>
<method name="EnumerateGroups">
<arg name="groups" direction="out" type="a(sa{sv})"/>
<arg name="groups" direction="out" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.StructType" value="Subject"/>
</arg>
</method>
<method name="EnumerateSessions">
<arg name="sessions" direction="out" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.StructType" value="Subject"/>
</arg>
</method>
<method name="EnumerateActions">
<arg name="locale" direction="in" type="s"/>
<arg name="action_descriptions" direction="out" type="a(ssssssa{ss})"/>
<arg name="action_descriptions" direction="out" type="a(ssssssa{ss})">
<annotation name="org.gtk.EggDBus.StructType" value="ActionDescription"/>
</arg>
</method>
<method name="CheckClaim">
......
......@@ -40,6 +40,11 @@
groups
<arg><option>--verbose</option></arg>
</arg>
<arg choice="plain">
<sbr/>
sessions
<arg><option>--verbose</option></arg>
</arg>
<arg choice="plain">
<sbr/>
authorizations
......@@ -171,6 +176,18 @@
</para>
</refsect2>
<refsect2>
<para>
<command>polkit-1 list sessions</command>
<arg><option>--verbose</option></arg>
</para>
<para>
Lists all sessions.
The returned identifiers can be used as <replaceable>subject</replaceable> parameters.
Prints detailed information about each session if <option>--verbose</option> is given.
</para>
</refsect2>
<refsect2>
<para>
<command>polkit-1 list authorizations</command>
......
......@@ -47,6 +47,7 @@ libpolkit_gobject_1include_HEADERS = \
polkitunixuser.h \
polkitunixgroup.h \
polkitunixprocess.h \
polkitunixsession.h \
polkitsystembusname.h \
polkitauthorizationclaim.h \
polkitauthorizationresult.h \
......@@ -62,6 +63,7 @@ libpolkit_gobject_1_la_SOURCES = \
polkitunixuser.c polkitunixuser.h \
polkitunixgroup.c polkitunixgroup.h \
polkitunixprocess.c polkitunixprocess.h \
polkitunixsession.c polkitunixsession.h \
polkitsystembusname.c polkitsystembusname.h \
polkitauthorizationclaim.c polkitauthorizationclaim.h \
polkitauthorizationresult.c polkitauthorizationresult.h \
......
......@@ -30,6 +30,7 @@
#include <polkit/polkitunixuser.h>
#include <polkit/polkitunixgroup.h>
#include <polkit/polkitunixprocess.h>
#include <polkit/polkitunixsession.h>
#include <polkit/polkitsystembusname.h>
#include <polkit/polkitauthorizationclaim.h>
#include <polkit/polkitauthorizationresult.h>
......
......@@ -242,7 +242,7 @@ polkit_authority_enumerate_users_async (PolkitAuthority *authority,
simple = g_simple_async_result_new (G_OBJECT (authority),
callback,
user_data,
polkit_authority_enumerate_actions_async);
polkit_authority_enumerate_users_async);
call_id = _polkit_authority_enumerate_users (authority->real,
EGG_DBUS_CALL_FLAGS_NONE,
......@@ -276,7 +276,7 @@ polkit_authority_enumerate_users_finish (PolkitAuthority *authority,
simple = G_SIMPLE_ASYNC_RESULT (res);
real_res = G_ASYNC_RESULT (g_simple_async_result_get_op_res_gpointer (simple));
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_authority_enumerate_actions_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_authority_enumerate_users_async);
result = NULL;
......@@ -338,7 +338,7 @@ polkit_authority_enumerate_groups_async (PolkitAuthority *authority,
simple = g_simple_async_result_new (G_OBJECT (authority),
callback,
user_data,
polkit_authority_enumerate_actions_async);
polkit_authority_enumerate_groups_async);
call_id = _polkit_authority_enumerate_groups (authority->real,
EGG_DBUS_CALL_FLAGS_NONE,
......@@ -372,7 +372,7 @@ polkit_authority_enumerate_groups_finish (PolkitAuthority *authority,
simple = G_SIMPLE_ASYNC_RESULT (res);
real_res = G_ASYNC_RESULT (g_simple_async_result_get_op_res_gpointer (simple));
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_authority_enumerate_actions_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_authority_enumerate_groups_async);
result = NULL;
......@@ -422,6 +422,102 @@ polkit_authority_enumerate_groups_sync (PolkitAuthority *authority,
/* ---------------------------------------------------------------------------------------------------- */
static guint
polkit_authority_enumerate_sessions_async (PolkitAuthority *authority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
guint call_id;
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new (G_OBJECT (authority),
callback,
user_data,
polkit_authority_enumerate_sessions_async);
call_id = _polkit_authority_enumerate_sessions (authority->real,
EGG_DBUS_CALL_FLAGS_NONE,
cancellable,
generic_async_cb,
simple);
return call_id;
}
void
polkit_authority_enumerate_sessions (PolkitAuthority *authority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
polkit_authority_enumerate_sessions_async (authority, cancellable, callback, user_data);
}
GList *
polkit_authority_enumerate_sessions_finish (PolkitAuthority *authority,
GAsyncResult *res,
GError **error)
{
EggDBusArraySeq *array_seq;
GList *result;
guint n;
GSimpleAsyncResult *simple;
GAsyncResult *real_res;
simple = G_SIMPLE_ASYNC_RESULT (res);
real_res = G_ASYNC_RESULT (g_simple_async_result_get_op_res_gpointer (simple));
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_authority_enumerate_sessions_async);
result = NULL;
if (!_polkit_authority_enumerate_sessions_finish (authority->real,
&array_seq,
real_res,
error))
goto out;
for (n = 0; n < array_seq->size; n++)
{
_PolkitSubject *real_subject;
real_subject = array_seq->data.v_ptr[n];
result = g_list_prepend (result, polkit_subject_new_for_real (real_subject));
}
result = g_list_reverse (result);
g_object_unref (array_seq);
out:
g_object_unref (real_res);
return result;
}
GList *
polkit_authority_enumerate_sessions_sync (PolkitAuthority *authority,
GCancellable *cancellable,
GError **error)
{
guint call_id;
GAsyncResult *res;
GList *result;
call_id = polkit_authority_enumerate_sessions_async (authority, cancellable, generic_cb, &res);
egg_dbus_connection_pending_call_block (authority->system_bus, call_id);
result = polkit_authority_enumerate_sessions_finish (authority, res, error);
g_object_unref (res);
return result;
}
/* ---------------------------------------------------------------------------------------------------- */
static guint
polkit_authority_check_claim_async (PolkitAuthority *authority,
PolkitAuthorizationClaim *claim,
......
......@@ -59,6 +59,10 @@ GList *polkit_authority_enumerate_groups_sync (PolkitAuthori
GCancellable *cancellable,
GError **error);
GList *polkit_authority_enumerate_sessions_sync (PolkitAuthority *authority,
GCancellable *cancellable,
GError **error);
PolkitAuthorizationResult polkit_authority_check_claim_sync (PolkitAuthority *authority,
PolkitAuthorizationClaim *claim,
GCancellable *cancellable,
......@@ -94,6 +98,15 @@ GList * polkit_authority_enumerate_groups_finish (PolkitAutho
GAsyncResult *res,
GError **error);
void polkit_authority_enumerate_sessions (PolkitAuthority *authority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList * polkit_authority_enumerate_sessions_finish (PolkitAuthority *authority,
GAsyncResult *res,
GError **error);
void polkit_authority_check_claim (PolkitAuthority *authority,
PolkitAuthorizationClaim *claim,
GCancellable *cancellable,
......
......@@ -29,6 +29,7 @@
#include "polkitunixuser.h"
#include "polkitunixgroup.h"
#include "polkitunixprocess.h"
#include "polkitunixsession.h"
#include "polkitsystembusname.h"
#include "polkiterror.h"
#include "polkitprivate.h"
......@@ -188,6 +189,11 @@ polkit_subject_new_for_real (_PolkitSubject *real)
s = polkit_unix_process_new_full (egg_dbus_variant_get_uint (variant),
egg_dbus_variant_get_uint64 (variant2));
}
else if (strcmp (kind, "unix-session") == 0)
{
variant = egg_dbus_hash_map_lookup (details, "session-id");
s = polkit_unix_session_new (egg_dbus_variant_get_string (variant));
}
else if (strcmp (kind, "system-bus-name") == 0)
{
variant = egg_dbus_hash_map_lookup (details, "name");
......@@ -236,6 +242,13 @@ polkit_subject_get_real (PolkitSubject *subject)
"start-time",
egg_dbus_variant_new_for_uint64 (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject))));
}
else if (POLKIT_IS_UNIX_SESSION (subject))
{
kind = "unix-session";
egg_dbus_hash_map_insert (details,
"session-id",
egg_dbus_variant_new_for_string (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject))));
}
else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
{
kind = "system-bus-name";
......
......@@ -41,6 +41,9 @@ typedef struct _PolkitUnixGroup PolkitUnixGroup;
struct _PolkitUnixProcess;
typedef struct _PolkitUnixProcess PolkitUnixProcess;
struct _PolkitUnixSession;
typedef struct _PolkitUnixSession PolkitUnixSession;
struct _PolkitSystemBusName;
typedef struct _PolkitSystemBusName PolkitSystemBusName;
......
/*
* Copyright (C) 2008 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include "polkitunixsession.h"
#include "polkitsubject.h"
#include "polkitprivate.h"
/**
* SECTION:polkitunixsession
* @title: PolkitUnixSession
* @short_description: Unix sessions
*
* Encapsulates a login session on UNIX.
*/
struct _PolkitUnixSession
{
GObject parent_instance;
gchar *session_id;
};
struct _PolkitUnixSessionClass
{
GObjectClass parent_class;
};
enum
{
PROP_0,
PROP_SESSION_ID,
};
static void subject_iface_init (PolkitSubjectIface *subject_iface);
G_DEFINE_TYPE_WITH_CODE (PolkitUnixSession, polkit_unix_session, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (POLKIT_TYPE_SUBJECT, subject_iface_init)
);
static void
polkit_unix_session_init (PolkitUnixSession *unix_session)
{
}
static void
polkit_unix_session_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
switch (prop_id)
{
case PROP_SESSION_ID:
g_value_set_string (value, session->session_id);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
polkit_unix_session_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
switch (prop_id)
{
case PROP_SESSION_ID:
polkit_unix_session_set_session_id (session, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
polkit_unix_session_class_init (PolkitUnixSessionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = polkit_unix_session_get_property;
gobject_class->set_property = polkit_unix_session_set_property;
/**
* PolkitUnixSession:session-id:
*
* The UNIX session id.
*/
g_object_class_install_property (gobject_class,
PROP_SESSION_ID,
g_param_spec_string ("session-id",
"Session ID",
"The UNIX session ID",
NULL,
G_PARAM_CONSTRUCT |
G_PARAM_READWRITE |
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_BLURB |
G_PARAM_STATIC_NICK));
}
const gchar *
polkit_unix_session_get_session_id (PolkitUnixSession *session)
{
return session->session_id;
}
void
polkit_unix_session_set_session_id (PolkitUnixSession *session,
const gchar *session_id)
{
g_free (session->session_id);
session->session_id = g_strdup (session_id);
}
PolkitSubject *
polkit_unix_session_new (const gchar *session_id)
{
return POLKIT_SUBJECT (g_object_new (POLKIT_TYPE_UNIX_SESSION,
"session-id", session_id,
NULL));
}
static gboolean
polkit_unix_session_equal (PolkitSubject *a,
PolkitSubject *b)
{
PolkitUnixSession *session_a;
PolkitUnixSession *session_b;
session_a = POLKIT_UNIX_SESSION (a);
session_b = POLKIT_UNIX_SESSION (b);
return g_strcmp0 (session_a->session_id, session_b->session_id) == 0;
}
static gchar *
polkit_unix_session_to_string (PolkitSubject *subject)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
return g_strdup_printf ("unix-session:%s", session->session_id);
}
static void
subject_iface_init (PolkitSubjectIface *subject_iface)
{
subject_iface->equal = polkit_unix_session_equal;
subject_iface->to_string = polkit_unix_session_to_string;
}
/*
* Copyright (C) 2008 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
#ifndef __POLKIT_UNIX_SESSION_H
#define __POLKIT_UNIX_SESSION_H
#include <glib-object.h>
#include <gio/gio.h>
#include <polkit/polkittypes.h>
G_BEGIN_DECLS
#define POLKIT_TYPE_UNIX_SESSION (polkit_unix_session_get_type())
#define POLKIT_UNIX_SESSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_UNIX_SESSION, PolkitUnixSession))
#define POLKIT_UNIX_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_UNIX_SESSION, PolkitUnixSessionClass))
#define POLKIT_UNIX_SESSION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_UNIX_SESSION, PolkitUnixSessionClass))
#define POLKIT_IS_UNIX_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_UNIX_SESSION))
#define POLKIT_IS_UNIX_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_UNIX_SESSION))
#if 0
typedef struct _PolkitUnixSession PolkitUnixSession;
#endif
typedef struct _PolkitUnixSessionClass PolkitUnixSessionClass;
GType polkit_unix_session_get_type (void) G_GNUC_CONST;
PolkitSubject *polkit_unix_session_new (const gchar *session_id);
const gchar *polkit_unix_session_get_session_id (PolkitUnixSession *session);
void polkit_unix_session_set_session_id (PolkitUnixSession *session,
const gchar *session_id);
G_END_DECLS
#endif /* __POLKIT_UNIX_SESSION_H */
......@@ -72,6 +72,17 @@ polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
klass->enumerate_groups (authority, pending_call);
}
void
polkit_backend_authority_enumerate_sessions (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call)
{
PolkitBackendAuthorityClass *klass;
klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);
klass->enumerate_sessions (authority, pending_call);
}
void
polkit_backend_authority_check_claim (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
......
......@@ -51,19 +51,22 @@ struct _PolkitBackendAuthorityClass
/*< public >*/
void (*enumerate_actions) (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
void (*enumerate_actions) (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
void (*enumerate_users) (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void (*enumerate_users) (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void (*enumerate_groups) (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void (*enumerate_groups) (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void (*check_claim) (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
void (*enumerate_sessions) (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void (*check_claim) (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
/*< private >*/
/* Padding for future expansion */
......@@ -81,33 +84,39 @@ GType polkit_backend_authority_get_type (void) G_GNUC_CONST;
/* --- */
void polkit_backend_authority_enumerate_actions (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_actions (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_enumerate_sessions (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_check_claim (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
void polkit_backend_authority_check_claim (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
/* --- */
void polkit_backend_authority_enumerate_actions_finish (PolkitBackendPendingCall *pending_call,
GList *actions);
void polkit_backend_authority_enumerate_actions_finish (PolkitBackendPendingCall *pending_call,
GList *actions);
void polkit_backend_authority_enumerate_users_finish (PolkitBackendPendingCall *pending_call,
GList *users);
void polkit_backend_authority_enumerate_users_finish (PolkitBackendPendingCall *pending_call,
GList *users);
void polkit_backend_authority_enumerate_groups_finish (PolkitBackendPendingCall *pending_call,
GList *groups);
void polkit_backend_authority_enumerate_groups_finish (PolkitBackendPendingCall *pending_call,
GList *groups);
void polkit_backend_authority_enumerate_sessions_finish (PolkitBackendPendingCall *pending_call,
GList *sessions);
void polkit_backend_authority_check_claim_finish (PolkitBackendPendingCall *pending_call,
PolkitAuthorizationResult result);
void polkit_backend_authority_check_claim_finish (PolkitBackendPendingCall *pending_call,
PolkitAuthorizationResult result);
G_END_DECLS
......
......@@ -38,19 +38,22 @@ typedef struct
} PolkitBackendLocalAuthorityPrivate;
static void polkit_backend_local_authority_enumerate_actions (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_actions (PolkitBackendAuthority *authority,
const gchar *locale,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_check_claim (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_enumerate_sessions (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call);
static void polkit_backend_local_authority_check_claim (PolkitBackendAuthority *authority,
PolkitAuthorizationClaim *claim,
PolkitBackendPendingCall *pending_call);
G_DEFINE_TYPE (PolkitBackendLocalAuthority, polkit_backend_local_authority, POLKIT_BACKEND_TYPE_AUTHORITY);
......@@ -100,10 +103,11 @@ polkit_backend_local_authority_class_init (PolkitBackendLocalAuthorityClass *kla
gobject_class->finalize = polkit_backend_local_authority_finalize;
authority_class->enumerate_actions = polkit_backend_local_authority_enumerate_actions;
authority_class->enumerate_users = polkit_backend_local_authority_enumerate_users;
authority_class->enumerate_groups = polkit_backend_local_authority_enumerate_groups;
authority_class->check_claim = polkit_backend_local_authority_check_claim;
authority_class->enumerate_actions = polkit_backend_local_authority_enumerate_actions;
authority_class->enumerate_users = polkit_backend_local_authority_enumerate_users;
authority_class->enumerate_groups = polkit_backend_local_authority_enumerate_groups;
authority_class->enumerate_sessions = polkit_backend_local_authority_enumerate_sessions;
authority_class->check_claim = polkit_backend_local_authority_check_claim;
g_type_class_add_private (klass, sizeof (PolkitBackendLocalAuthorityPrivate));
}
......@@ -135,6 +139,8 @@ polkit_backend_local_authority_enumerate_actions (PolkitBackendAuthority *auth
actions);
}
/* ---------------------------------------------------------------------------------------------------- */
static void
polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call)
......@@ -179,6 +185,8 @@ polkit_backend_local_authority_enumerate_users (PolkitBackendAuthority *author
;
}
/* ---------------------------------------------------------------------------------------------------- */
static void
polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call)
......@@ -223,6 +231,26 @@ polkit_backend_local_authority_enumerate_groups (PolkitBackendAuthority *autho
;
}
/* ---------------------------------------------------------------------------------------------------- */
static void
polkit_backend_local_authority_enumerate_sessions (PolkitBackendAuthority *authority,
PolkitBackendPendingCall *pending_call)
{
PolkitBackendLocalAuthority *local_authority;
PolkitBackendLocalAuthorityPrivate *priv;
GList *list;
local_authority = POLKIT_BACKEND_LOCAL_AUTHORITY (authority);
priv = POLKIT_BACKEND_LOCAL_AUTHORITY_GET_PRIVATE (local_authority);
list = polkit_backend_session_monitor_get_sessions (priv->session_monitor);
polkit_backend_authority_enumerate_sessions_finish (pending_call, list);
}
/* ---------------------------------------------------------------------------------------------------- */
static void
polkit_backend_local_authority_check_claim (PolkitBackendAuthority *authority