Commit 2434044d authored by David Zeuthen's avatar David Zeuthen

Move local authority management to a separate library

parent e88e67fa
......@@ -409,8 +409,10 @@ data/polkit-1
data/polkit-gobject-1.pc
data/polkit-backend-1.pc
data/polkit-agent-1.pc
data/polkit-local-1.pc
src/Makefile
src/polkit/Makefile
src/polkitlocal/Makefile
src/polkitbackend/Makefile
src/polkitagent/Makefile
src/polkitd/Makefile
......
......@@ -22,13 +22,13 @@ pam_DATA = polkit-1
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc
pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc polkit-local-1.pc
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
org.freedesktop.PolicyKit1.Authority.xml \
org.freedesktop.PolicyKit1.AuthorityManager.xml \
org.freedesktop.PolicyKit1.LocalAuthority.xml \
org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
$(service_in_files) \
$(dbusconf_in_files) \
......@@ -36,6 +36,7 @@ EXTRA_DIST = \
polkit-gobject-1.pc.in \
polkit-backend-1.pc.in \
polkit-agent-1.pc.in \
polkit-local-1.pc.in \
$(NULL)
......
......@@ -2,12 +2,12 @@
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.PolicyKit1.AuthorityManager">
<annotation name="org.gtk.EggDBus.DocString.Summary" value="Manage an Authority"/>
<interface name="org.freedesktop.PolicyKit1.LocalAuthority">
<annotation name="org.gtk.EggDBus.DocString.Summary" value="Manage the local Authority"/>
<annotation name="org.gtk.EggDBus.DocString" value="This D-Bus interface <emphasis>may</emphasis> be implemented by the <literal>/org/freedesktop/PoliycKit1/Authority</literal> object on the well-known name <literal>org.freedesktop.PolicyKit1</literal> on the system message bus."/>
<!-- Authorization struct -->
<annotation name="org.gtk.EggDBus.DeclareStruct" value="Authorization">
<annotation name="org.gtk.EggDBus.DeclareStruct" value="LocalAuthorization">
<annotation name="org.gtk.EggDBus.DocString.Summary" value="Authorizations"/>
<annotation name="org.gtk.EggDBus.DocString" value="This struct describes an authorization belonging to an #Identity."/>
......@@ -51,8 +51,8 @@
<annotation name="org.gtk.EggDBus.DocString" value="The #Identity to add @authorization to."/>
</arg>
<arg name="authorization" direction="in" type="(s(sa{sv})b)">
<annotation name="org.gtk.EggDBus.Type" value="Authorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #Authorization to add to @identity."/>
<annotation name="org.gtk.EggDBus.Type" value="LocalAuthorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #LocalAuthorization to add to @identity."/>
</arg>
</method>
......@@ -64,8 +64,8 @@
<annotation name="org.gtk.EggDBus.DocString" value="The #Identity to remove @authorization from."/>
</arg>
<arg name="authorization" direction="in" type="(s(sa{sv})b)">
<annotation name="org.gtk.EggDBus.Type" value="Authorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #Authorization to remove from @identity."/>
<annotation name="org.gtk.EggDBus.Type" value="LocalAuthorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #LocalAuthorization to remove from @identity."/>
</arg>
</method>
......@@ -78,8 +78,8 @@
<annotation name="org.gtk.EggDBus.DocString" value="An #Identity to enumerate authorizations for."/>
</arg>
<arg name="authorizations" direction="out" type="a(s(sa{sv})b)">
<annotation name="org.gtk.EggDBus.Type" value="Array<Authorization>"/>
<annotation name="org.gtk.EggDBus.DocString" value="An array of #Authorization structs for @identity."/>
<annotation name="org.gtk.EggDBus.Type" value="Array<LocalAuthorization>"/>
<annotation name="org.gtk.EggDBus.DocString" value="An array of #LocalAuthorization structs for @identity."/>
</arg>
</method>
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: polkit-local-1
Description: PolicyKit Local Authority API
Version: @VERSION@
Libs: -L${libdir} -lpolkit-local-1
Cflags: -I${includedir}/polkit-1
Requires: polkit-gobject-1
......@@ -35,6 +35,8 @@ INCLUDES = \
-I$(top_builddir)/src/polkitbackend \
-I$(top_srcdir)/src/polkitagent \
-I$(top_builddir)/src/polkitagent \
-I$(top_srcdir)/src/polkitlocal \
-I$(top_builddir)/src/polkitlocal \
$(NULL)
GTKDOC_LIBS = \
......@@ -44,6 +46,7 @@ GTKDOC_LIBS = \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(top_builddir)/src/polkitbackend/libpolkit-backend-1.la \
$(top_builddir)/src/polkitagent/libpolkit-agent-1.la \
$(top_builddir)/src/polkitlocal/libpolkit-local-1.la \
$(NULL)
# Extra options to supply to gtkdoc-mkdb
......@@ -58,7 +61,7 @@ content_files = \
../extensiondir.xml \
../version.xml \
../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml \
../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthorityManager.xml \
../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.LocalAuthority.xml \
../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
../man/PolicyKit-1.xml \
../man/pkcheck.xml \
......
......@@ -62,19 +62,17 @@
<part id="ref-dbus-api">
<title>D-Bus API Reference</title>
<xi:include href="../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.xml"/>
<xi:include href="../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthorityManager.xml"/>
<xi:include href="../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.LocalAuthority.xml"/>
<xi:include href="../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml"/>
</part>
<part id="ref-api">
<title>Core API Reference</title>
<title>Client API Reference</title>
<xi:include href="xml/polkitauthority.xml"/>
<xi:include href="xml/polkitauthorizationresult.xml"/>
<xi:include href="xml/polkitdetails.xml"/>
<xi:include href="xml/polkiterror.xml"/>
<xi:include href="xml/polkitactiondescription.xml"/>
<xi:include href="xml/polkitauthoritymanager.xml"/>
<xi:include href="xml/polkitauthorization.xml"/>
<chapter id="subjects">
<title>Subjects</title>
<xi:include href="xml/polkitsubject.xml"/>
......@@ -90,6 +88,12 @@
</chapter>
</part>
<part id="ref-local-api">
<title>Local Authority Client API Reference</title>
<xi:include href="xml/polkitlocalauthority.xml"/>
<xi:include href="xml/polkitlocalauthorization.xml"/>
</part>
<part id="ref-backend-api">
<title>Backend API Reference</title>
<xi:include href="xml/polkitbackendauthority.xml"/>
......
......@@ -48,33 +48,33 @@ POLKIT_AUTHORITY_GET_CLASS
</SECTION>
<SECTION>
<FILE>polkitauthoritymanager</FILE>
PolkitAuthorityManager
polkit_authority_manager_get
polkit_authority_manager_enumerate_users_sync
polkit_authority_manager_enumerate_groups_sync
polkit_authority_manager_enumerate_authorizations_sync
polkit_authority_manager_add_authorization_sync
polkit_authority_manager_remove_authorization_sync
polkit_authority_manager_enumerate_users
polkit_authority_manager_enumerate_users_finish
polkit_authority_manager_enumerate_groups
polkit_authority_manager_enumerate_groups_finish
polkit_authority_manager_enumerate_authorizations
polkit_authority_manager_enumerate_authorizations_finish
polkit_authority_manager_add_authorization
polkit_authority_manager_add_authorization_finish
polkit_authority_manager_remove_authorization
polkit_authority_manager_remove_authorization_finish
<FILE>polkitlocalauthority</FILE>
PolkitLocalAuthority
polkit_local_authority_get
polkit_local_authority_enumerate_users_sync
polkit_local_authority_enumerate_groups_sync
polkit_local_authority_enumerate_authorizations_sync
polkit_local_authority_add_authorization_sync
polkit_local_authority_remove_authorization_sync
polkit_local_authority_enumerate_users
polkit_local_authority_enumerate_users_finish
polkit_local_authority_enumerate_groups
polkit_local_authority_enumerate_groups_finish
polkit_local_authority_enumerate_authorizations
polkit_local_authority_enumerate_authorizations_finish
polkit_local_authority_add_authorization
polkit_local_authority_add_authorization_finish
polkit_local_authority_remove_authorization
polkit_local_authority_remove_authorization_finish
<SUBSECTION Standard>
PolkitAuthorityManagerClass
POLKIT_AUTHORITY_MANAGER
POLKIT_IS_AUTHORITY_MANAGER
POLKIT_TYPE_AUTHORITY_MANAGER
polkit_authority_manager_get_type
POLKIT_AUTHORITY_MANAGER_CLASS
POLKIT_IS_AUTHORITY_MANAGER_CLASS
POLKIT_AUTHORITY_MANAGER_GET_CLASS
POLKIT_LOCAL_AUTHORITY
POLKIT_IS_LOCAL_AUTHORITY
POLKIT_TYPE_LOCAL_AUTHORITY
polkit_local_authority_get_type
POLKIT_LOCAL_AUTHORITY_CLASS
POLKIT_IS_LOCAL_AUTHORITY_CLASS
POLKIT_LOCAL_AUTHORITY_GET_CLASS
</SECTION>
<SECTION>
......@@ -131,21 +131,21 @@ POLKIT_UNIX_GROUP_GET_CLASS
</SECTION>
<SECTION>
<FILE>polkitauthorization</FILE>
PolkitAuthorization
polkit_authorization_new
polkit_authorization_get_action_id
polkit_authorization_get_subject
polkit_authorization_get_is_negative
<FILE>polkitlocalauthorization</FILE>
PolkitLocalAuthorization
polkit_local_authorization_new
polkit_local_authorization_get_action_id
polkit_local_authorization_get_subject
polkit_local_authorization_get_is_negative
<SUBSECTION Standard>
PolkitAuthorizationClass
POLKIT_AUTHORIZATION
POLKIT_IS_AUTHORIZATION
POLKIT_TYPE_AUTHORIZATION
polkit_authorization_get_type
POLKIT_AUTHORIZATION_CLASS
POLKIT_IS_AUTHORIZATION_CLASS
POLKIT_AUTHORIZATION_GET_CLASS
PolkitLocalAuthorizationClass
POLKIT_LOCAL_AUTHORIZATION
POLKIT_IS_LOCAL_AUTHORIZATION
POLKIT_TYPE_LOCAL_AUTHORIZATION
polkit_local_authorization_get_type
POLKIT_LOCAL_AUTHORIZATION_CLASS
POLKIT_IS_LOCAL_AUTHORIZATION_CLASS
POLKIT_LOCAL_AUTHORIZATION_GET_CLASS
</SECTION>
<SECTION>
......
polkit_authority_get_type
polkit_authority_manager_get_type
polkit_authorization_get_type
polkit_action_description_get_type
polkit_details_get_type
polkit_check_authorization_flags_get_type
polkit_implicit_authorization_get_type
polkit_identity_get_type
polkit_unix_user_get_type
polkit_unix_group_get_type
polkit_subject_get_type
polkit_unix_process_get_type
polkit_unix_session_get_type
......@@ -19,6 +13,9 @@ polkit_system_bus_name_get_type
polkit_error_get_type
polkit_authorization_result_get_type
polkit_local_authority_get_type
polkit_local_authorization_get_type
polkit_backend_authority_get_type
polkit_backend_action_lookup_get_type
polkit_backend_local_authority_get_type
......
SUBDIRS = polkit polkitbackend polkitagent polkitd nullbackend programs examples
SUBDIRS = polkit polkitlocal polkitbackend polkitagent polkitd nullbackend programs examples
clean-local :
rm -f *~
......@@ -27,6 +27,7 @@ libnullbackend_la_SOURCES = \
libnullbackend_la_CFLAGS = \
-DPOLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
-DPOLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
-DG_LOG_DOMAIN=\"PolkitNullBackend\" \
$(GLIB_CFLAGS) \
$(NULL)
......
......@@ -22,19 +22,19 @@ BUILT_SOURCES = \
# Build all the PolicyKit D-Bus code here, even the code we
# only in the daemon for agent interaction
#
polkit-built-sources.stamp : Makefile.am $(top_srcdir)/data/org.freedesktop.PolicyKit1.Authority.xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.AuthorityManager.xml
polkit-built-sources.stamp : Makefile.am $(top_srcdir)/data/org.freedesktop.PolicyKit1.Authority.xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.LocalAuthority.xml
eggdbus-binding-tool \
--namespace "_Polkit" \
--dbus-namespace "org.freedesktop.PolicyKit1" \
--introspection-xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.Authority.xml \
--introspection-xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.AuthorityManager.xml \
--introspection-xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.LocalAuthority.xml \
--introspection-xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
--stamp-file polkit-built-sources.stamp \
--stamp-file polkit-built-sources.stamp \
$(NULL)
# keep in sync with contents of polkit-built-sources.stamp (Thanks autotools)
#
polkit_built_sources = _polkitbindingsmarshal.c _polkitbindingsmarshal.h _polkitbindingsmarshal.list _polkitbindings.c _polkitbindings.h _polkitbindingstypes.h _polkitauthenticationagent.c _polkitauthenticationagent.h docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml _polkitauthoritymanager.c _polkitauthoritymanager.h docbook-interface-org.freedesktop.PolicyKit1.AuthorityManager.xml _polkitauthority.c _polkitauthority.h docbook-interface-org.freedesktop.PolicyKit1.Authority.xml _polkiterror.c _polkiterror.h _polkitimplicitauthorization.c _polkitimplicitauthorization.h _polkitauthorizationresult.c _polkitauthorizationresult.h _polkitcheckauthorizationflags.c _polkitcheckauthorizationflags.h _polkitauthorization.c _polkitauthorization.h _polkitactiondescription.c _polkitactiondescription.h _polkitidentity.c _polkitidentity.h _polkitsubject.c _polkitsubject.h
polkit_built_sources = _polkitbindingsmarshal.c _polkitbindingsmarshal.h _polkitbindingsmarshal.list _polkitbindings.c _polkitbindings.h _polkitbindingstypes.h _polkitauthenticationagent.c _polkitauthenticationagent.h docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml _polkitlocalauthority.c _polkitlocalauthority.h docbook-interface-org.freedesktop.PolicyKit1.LocalAuthority.xml _polkitauthority.c _polkitauthority.h docbook-interface-org.freedesktop.PolicyKit1.Authority.xml _polkiterror.c _polkiterror.h _polkitimplicitauthorization.c _polkitimplicitauthorization.h _polkitauthorizationresult.c _polkitauthorizationresult.h _polkitcheckauthorizationflags.c _polkitcheckauthorizationflags.h _polkitlocalauthorization.c _polkitlocalauthorization.h _polkitactiondescription.c _polkitactiondescription.h _polkitidentity.c _polkitidentity.h _polkitsubject.c _polkitsubject.h
lib_LTLIBRARIES=libpolkit-gobject-1.la
......@@ -47,7 +47,6 @@ libpolkit_gobject_1include_HEADERS = \
polkitactiondescription.h \
polkitdetails.h \
polkitauthority.h \
polkitauthoritymanager.h \
polkiterror.h \
polkitsubject.h \
polkitunixprocess.h \
......@@ -58,7 +57,6 @@ libpolkit_gobject_1include_HEADERS = \
polkitunixgroup.h \
polkitauthorizationresult.h \
polkitcheckauthorizationflags.h \
polkitauthorization.h \
polkitimplicitauthorization.h \
$(NULL)
......@@ -69,7 +67,6 @@ libpolkit_gobject_1_la_SOURCES = \
polkitactiondescription.c polkitactiondescription.h \
polkitdetails.c polkitdetails.h \
polkitauthority.c polkitauthority.h \
polkitauthoritymanager.c polkitauthoritymanager.h \
polkiterror.c polkiterror.h \
polkitsubject.c polkitsubject.h \
polkitunixprocess.c polkitunixprocess.h \
......@@ -80,7 +77,6 @@ libpolkit_gobject_1_la_SOURCES = \
polkitunixgroup.c polkitunixgroup.h \
polkitauthorizationresult.c polkitauthorizationresult.h \
polkitcheckauthorizationflags.c polkitcheckauthorizationflags.h \
polkitauthorization.c polkitauthorization.h \
polkitimplicitauthorization.c polkitimplicitauthorization.h \
$(NULL)
......
......@@ -37,8 +37,6 @@
#include <polkit/polkitauthorizationresult.h>
#include <polkit/polkitcheckauthorizationflags.h>
#include <polkit/polkitauthority.h>
#include <polkit/polkitauthoritymanager.h>
#include <polkit/polkitauthorization.h>
#include <polkit/polkitdetails.h>
#undef _POLKIT_INSIDE_POLKIT_H
......
......@@ -44,9 +44,6 @@ _PolkitSubject *polkit_subject_get_real (PolkitSubject *subject);
PolkitIdentity *polkit_identity_new_for_real (_PolkitIdentity *real);
_PolkitIdentity *polkit_identity_get_real (PolkitIdentity *identity);
PolkitAuthorization *polkit_authorization_new_for_real (_PolkitAuthorization *real);
_PolkitAuthorization *polkit_authorization_get_real (PolkitAuthorization *authorization);
PolkitAuthorizationResult *polkit_authorization_result_new_for_real (_PolkitAuthorizationResult *real);
_PolkitAuthorizationResult *polkit_authorization_result_get_real (PolkitAuthorizationResult *authorization_result);
......
......@@ -27,9 +27,6 @@
struct _PolkitAuthority;
typedef struct _PolkitAuthority PolkitAuthority;
struct _PolkitAuthorityManager;
typedef struct _PolkitAuthorityManager PolkitAuthorityManager;
struct _PolkitActionDescription;
typedef struct _PolkitActionDescription PolkitActionDescription;
......@@ -52,9 +49,6 @@ typedef struct _PolkitUnixUser PolkitUnixUser;
struct _PolkitUnixGroup;
typedef struct _PolkitUnixGroup PolkitUnixGroup;
struct _PolkitAuthorization;
typedef struct _PolkitAuthorization PolkitAuthorization;
struct _PolkitAuthorizationResult;
typedef struct _PolkitAuthorizationResult PolkitAuthorizationResult;
......
......@@ -5,6 +5,8 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/src/polkit \
-I$(top_srcdir)/src/polkit \
-I$(top_builddir)/src/polkitlocal \
-I$(top_srcdir)/src/polkitlocal \
-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
......@@ -15,6 +17,7 @@ INCLUDES = \
-D_POSIX_PTHREAD_SEMANTICS \
-D_REENTRANT \
-DEGG_DBUS_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
-DPOLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
$(NULL)
BUILT_SOURCES = \
......@@ -48,18 +51,18 @@ libpolkit_backend_1include_HEADERS = \
polkitbackendactionlookup.h \
$(NULL)
libpolkit_backend_1_la_SOURCES = \
$(ck_built_sources) \
$(BUILT_SOURCES) \
polkitbackend.h \
polkitbackendtypes.h \
polkitbackendprivate.h \
polkitbackendauthority.h polkitbackendauthority.c \
polkitbackendlocalauthority.h polkitbackendlocalauthority.c \
polkitbackendactionpool.h polkitbackendactionpool.c \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c \
polkitbackendconfigsource.h polkitbackendconfigsource.c \
polkitbackendactionlookup.h polkitbackendactionlookup.c \
libpolkit_backend_1_la_SOURCES = \
$(ck_built_sources) \
$(BUILT_SOURCES) \
polkitbackend.h \
polkitbackendtypes.h \
polkitbackendprivate.h \
polkitbackendauthority.h polkitbackendauthority.c \
polkitbackendlocalauthority.h polkitbackendlocalauthority.c \
polkitbackendactionpool.h polkitbackendactionpool.c \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c \
polkitbackendconfigsource.h polkitbackendconfigsource.c \
polkitbackendactionlookup.h polkitbackendactionlookup.c \
$(NULL)
libpolkit_backend_1_la_CFLAGS = \
......@@ -73,6 +76,7 @@ libpolkit_backend_1_la_LIBADD = \
$(GLIB_LIBS) \
$(EGG_DBUS_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(top_builddir)/src/polkitlocal/libpolkit-local-1.la \
$(EXPAT_LIBS) \
$(NULL)
......
......@@ -23,8 +23,13 @@
#include <errno.h>
#include <pwd.h>
#include <string.h>
#include <polkit/polkit.h>
#include <polkit/polkitprivate.h>
#include <polkitlocal/polkitlocal.h>
#include <polkitlocal/polkitlocalprivate.h>
#include "polkitbackendauthority.h"
#include "polkitbackendactionlookup.h"
#include "polkitbackendlocalauthority.h"
......@@ -295,7 +300,7 @@ polkit_backend_authority_check_authorization_finish (PolkitBackendAuthority *au
*
* Retrieves all authorizations for @identity.
*
* Returns: A list of #PolkitAuthorization objects or %NULL if @error is set. The returned list
* Returns: A list of #PolkitLocalAuthorization 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 *
......@@ -338,7 +343,7 @@ gboolean
polkit_backend_authority_add_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
PolkitLocalAuthorization *authorization,
GError **error)
{
PolkitBackendAuthorityClass *klass;
......@@ -375,7 +380,7 @@ gboolean
polkit_backend_authority_remove_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitAuthorization *authorization,
PolkitLocalAuthorization *authorization,
GError **error)
{
PolkitBackendAuthorityClass *klass;
......@@ -551,11 +556,11 @@ struct _ServerClass
};
static void authority_iface_init (_PolkitAuthorityIface *authority_iface);
static void authority_manager_iface_init (_PolkitAuthorityManagerIface *authority_manager_iface);
static void local_authority_iface_init (_PolkitLocalAuthorityIface *local_authority_iface);
G_DEFINE_TYPE_WITH_CODE (Server, server, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (_POLKIT_TYPE_AUTHORITY, authority_iface_init)
G_IMPLEMENT_INTERFACE (_POLKIT_TYPE_AUTHORITY_MANAGER, authority_manager_iface_init)
G_IMPLEMENT_INTERFACE (_POLKIT_TYPE_LOCAL_AUTHORITY, local_authority_iface_init)
);
static void
......@@ -674,7 +679,7 @@ authority_handle_enumerate_actions (_PolkitAuthority *instance,
/* ---------------------------------------------------------------------------------------------------- */
static void
authority_manager_handle_enumerate_users (_PolkitAuthorityManager *instance,
local_authority_handle_enumerate_users (_PolkitLocalAuthority *instance,
EggDBusMethodInvocation *method_invocation)
{
Server *server = SERVER (instance);
......@@ -712,7 +717,7 @@ authority_manager_handle_enumerate_users (_PolkitAuthorityManager *instance,
egg_dbus_array_seq_add (array, real);
}
_polkit_authority_manager_handle_enumerate_users_finish (method_invocation, array);
_polkit_local_authority_handle_enumerate_users_finish (method_invocation, array);
g_object_unref (array);
......@@ -727,7 +732,7 @@ authority_manager_handle_enumerate_users (_PolkitAuthorityManager *instance,
/* ---------------------------------------------------------------------------------------------------- */
static void
authority_manager_handle_enumerate_groups (_PolkitAuthorityManager *instance,
local_authority_handle_enumerate_groups (_PolkitLocalAuthority *instance,
EggDBusMethodInvocation *method_invocation)
{
Server *server = SERVER (instance);
......@@ -765,7 +770,7 @@ authority_manager_handle_enumerate_groups (_PolkitAuthorityManager *instance,
egg_dbus_array_seq_add (array, real);
}
_polkit_authority_manager_handle_enumerate_groups_finish (method_invocation, array);
_polkit_local_authority_handle_enumerate_groups_finish (method_invocation, array);
g_object_unref (array);
......@@ -922,7 +927,7 @@ authority_handle_cancel_check_authorization (_PolkitAuthority *ins
/* ---------------------------------------------------------------------------------------------------- */
static void
authority_manager_handle_enumerate_authorizations (_PolkitAuthorityManager *instance,
local_authority_handle_enumerate_authorizations (_PolkitLocalAuthority *instance,
_PolkitIdentity *real_identity,
EggDBusMethodInvocation *method_invocation)
{
......@@ -959,14 +964,14 @@ authority_manager_handle_enumerate_authorizations (_PolkitAuthorityManager
for (l = authorizations; l != NULL; l = l->next)
{
PolkitAuthorization *authorization = POLKIT_AUTHORIZATION (l->data);
_PolkitAuthorization *real;
PolkitLocalAuthorization *authorization = POLKIT_LOCAL_AUTHORIZATION (l->data);
_PolkitLocalAuthorization *real;
real = polkit_authorization_get_real (authorization);
real = polkit_local_authorization_get_real (authorization);
egg_dbus_array_seq_add (array, real);
}
_polkit_authority_manager_handle_enumerate_authorizations_finish (method_invocation, array);
_polkit_local_authority_handle_enumerate_authorizations_finish (method_invocation, array);
g_object_unref (array);
......@@ -983,15 +988,15 @@ authority_manager_handle_enumerate_authorizations (_PolkitAuthorityManager
/* ---------------------------------------------------------------------------------------------------- */
static void
authority_manager_handle_add_authorization (_PolkitAuthorityManager *instance,
local_authority_handle_add_authorization (_PolkitLocalAuthority *instance,
_PolkitIdentity *real_identity,
_PolkitAuthorization *real_authorization,
_PolkitLocalAuthorization *real_authorization,
EggDBusMethodInvocation *method_invocation)
{
Server *server = SERVER (instance);
PolkitSubject *caller;
PolkitIdentity *identity;
PolkitAuthorization *authorization;
PolkitLocalAuthorization *authorization;
GError *error;
......@@ -999,7 +1004,7 @@ authority_manager_handle_add_authorization (_PolkitAuthorityManager *inst
identity = polkit_identity_new_for_real (real_identity);
authorization = polkit_authorization_new_for_real (real_authorization);
authorization = polkit_local_authorization_new_for_real (real_authorization);
error = NULL;
if (!polkit_backend_authority_add_authorization (server->authority,
......@@ -1013,7 +1018,7 @@ authority_manager_handle_add_authorization (_PolkitAuthorityManager *inst
goto out;
}
_polkit_authority_manager_handle_add_authorization_finish (method_invocation);
_polkit_local_authority_handle_add_authorization_finish (method_invocation);
out:
g_object_unref (authorization);
......@@ -1024,15 +1029,15 @@ authority_manager_handle_add_authorization (_PolkitAuthorityManager *inst
/* ---------------------------------------------------------------------------------------------------- */
static void
authority_manager_handle_remove_authorization (_PolkitAuthorityManager *instance,
local_authority_handle_remove_authorization (_PolkitLocalAuthority *instance,
_PolkitIdentity *real_identity,
_PolkitAuthorization *real_authorization,
_PolkitLocalAuthorization *real_authorization,
EggDBusMethodInvocation *method_invocation)
{
Server *server = SERVER (instance);
PolkitSubject *caller;
PolkitIdentity *identity;
PolkitAuthorization *authorization;
PolkitLocalAuthorization *authorization;
GError *error;
......@@ -1040,7 +1045,7 @@ authority_manager_handle_remove_authorization (_PolkitAuthorityManager *i
identity = polkit_identity_new_for_real (real_identity);
authorization = polkit_authorization_new_for_real (real_authorization);
authorization = polkit_local_authorization_new_for_real (real_authorization);
error = NULL;
if (!polkit_backend_authority_remove_authorization (server->authority,
......@@ -1054,7 +1059,7 @@ authority_manager_handle_remove_authorization (_PolkitAuthorityManager *i
goto out;
}
_polkit_authority_manager_handle_remove_authorization_finish (method_invocation);
_polkit_local_authority_handle_remove_authorization_finish (method_invocation);
out:
g_object_unref (authorization);
......@@ -1179,13 +1184,13 @@ authority_iface_init (_PolkitAuthorityIface *authority_iface)
}
static void
authority_manager_iface_init (_PolkitAuthorityManagerIface *authority_manager_iface)
local_authority_iface_init (_PolkitLocalAuthorityIface *local_authority_iface)
{
authority_manager_iface->handle_enumerate_users = authority_manager_handle_enumerate_users;
authority_manager_iface->handle_enumerate_groups = authority_manager_handle_enumerate_groups;
authority_manager_iface->handle_enumerate_authorizations = authority_manager_handle_enumerate_authorizations;
authority_manager_iface->handle_add_authorization = authority_manager_handle_add_authorization;
authority_manager_iface->handle_remove_authorization = authority_manager_handle_remove_authorization;
local_authority_iface->handle_enumerate_users = local_authority_handle_enumerate_users;
local_authority_iface->handle_enumerate_groups = local_authority_handle_enumerate_groups;
local_authority_iface->handle_enumerate_authorizations = local_authority_handle_enumerate_authorizations;
local_authority_iface->handle_add_authorization = local_authority_handle_add_authorization;
local_authority_iface->handle_remove_authorization = local_authority_handle_remove_authorization;
}