Commit 20d1288f authored by David Zeuthen's avatar David Zeuthen

Rip out polkit-local and refactor local authority to only use tmp authz

parent 2434044d
......@@ -409,10 +409,8 @@ 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,12 @@ pam_DATA = polkit-1
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc polkit-local-1.pc
pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
org.freedesktop.PolicyKit1.Authority.xml \
org.freedesktop.PolicyKit1.LocalAuthority.xml \
org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
$(service_in_files) \
$(dbusconf_in_files) \
......@@ -36,7 +35,6 @@ EXTRA_DIST = \
polkit-gobject-1.pc.in \
polkit-backend-1.pc.in \
polkit-agent-1.pc.in \
polkit-local-1.pc.in \
$(NULL)
......
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<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="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."/>
<annotation name="org.gtk.EggDBus.Struct.Member" value="String:action_id">
<annotation name="org.gtk.EggDBus.DocString" value="Identifier for the action the authorization is for."/>
</annotation>
<annotation name="org.gtk.EggDBus.Struct.Member" value="Subject:subject">
<annotation name="org.gtk.EggDBus.Type" value="Subject"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #Subject that the authorization applies to."/>
</annotation>
<annotation name="org.gtk.EggDBus.Struct.Member" value="Boolean:is_negative">
<annotation name="org.gtk.EggDBus.DocString" value="Whether the authorization is negative."/>
</annotation>
</annotation>
<method name="EnumerateUsers">
<annotation name="org.gtk.EggDBus.DocString" value="Enumerate all users known to the authority."/>
<arg name="users" direction="out" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Array<Identity>"/>
<annotation name="org.gtk.EggDBus.DocString" value="An array of #Identity structs."/>
</arg>
</method>
<method name="EnumerateGroups">
<annotation name="org.gtk.EggDBus.DocString" value="Enumerate all groups known to the authority."/>
<arg name="groups" direction="out" type="a(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Array<Identity>"/>
<annotation name="org.gtk.EggDBus.DocString" value="An array of #Identity structs."/>
</arg>
</method>
<method name="AddAuthorization">
<annotation name="org.gtk.EggDBus.DocString" value="Add an authorization to @identity."/>
<arg name="identity" direction="in" type="(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Identity"/>
<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="LocalAuthorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #LocalAuthorization to add to @identity."/>
</arg>
</method>
<method name="RemoveAuthorization">
<annotation name="org.gtk.EggDBus.DocString" value="Remove an authorization from @identity."/>
<arg name="identity" direction="in" type="(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Identity"/>
<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="LocalAuthorization"/>
<annotation name="org.gtk.EggDBus.DocString" value="The #LocalAuthorization to remove from @identity."/>
</arg>
</method>
<method name="EnumerateAuthorizations">
<annotation name="org.gtk.EggDBus.DocString" value="Enumerate all authorizations for @identity."/>
<arg name="identity" direction="in" type="(sa{sv})">
<annotation name="org.gtk.EggDBus.Type" value="Identity"/>
<annotation name="org.gtk.EggDBus.StructType" value="Identity"/>
<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<LocalAuthorization>"/>
<annotation name="org.gtk.EggDBus.DocString" value="An array of #LocalAuthorization structs for @identity."/>
</arg>
</method>
</interface>
</node>
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,8 +35,6 @@ 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 = \
......@@ -46,7 +44,6 @@ 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
......@@ -61,7 +58,6 @@ content_files = \
../extensiondir.xml \
../version.xml \
../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.Authority.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,7 +62,6 @@
<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.LocalAuthority.xml"/>
<xi:include href="../../src/polkit/docbook-interface-org.freedesktop.PolicyKit1.AuthenticationAgent.xml"/>
</part>
......@@ -88,12 +87,6 @@
</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"/>
......
......@@ -47,36 +47,6 @@ POLKIT_IS_AUTHORITY_CLASS
POLKIT_AUTHORITY_GET_CLASS
</SECTION>
<SECTION>
<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_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>
<FILE>polkitauthorizationresult</FILE>
PolkitAuthorizationResult
......@@ -130,24 +100,6 @@ POLKIT_IS_UNIX_GROUP_CLASS
POLKIT_UNIX_GROUP_GET_CLASS
</SECTION>
<SECTION>
<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>
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>
<FILE>polkitunixsession</FILE>
PolkitUnixSession
......
......@@ -13,9 +13,6 @@ 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 polkitlocal polkitbackend polkitagent polkitd nullbackend programs examples
SUBDIRS = polkit polkitbackend polkitagent polkitd nullbackend programs examples
clean-local :
rm -f *~
......@@ -27,7 +27,6 @@ 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,18 @@ 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.LocalAuthority.xml
polkit-built-sources.stamp : Makefile.am $(top_srcdir)/data/org.freedesktop.PolicyKit1.Authority.xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.AuthenticationAgent.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.LocalAuthority.xml \
--introspection-xml $(top_srcdir)/data/org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
--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 _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
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 _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 _polkitactiondescription.c _polkitactiondescription.h _polkitidentity.c _polkitidentity.h _polkitsubject.c _polkitsubject.h
lib_LTLIBRARIES=libpolkit-gobject-1.la
......
......@@ -5,8 +5,6 @@ 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)"\" \
......@@ -17,7 +15,6 @@ 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 = \
......@@ -76,7 +73,6 @@ 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)
......
This diff is collapsed.
......@@ -27,7 +27,6 @@
#define __POLKIT_BACKEND_AUTHORITY_H
#include <glib-object.h>
#include <polkitlocal/polkitlocal.h>
#include "polkitbackendtypes.h"
......@@ -87,21 +86,6 @@ struct _PolkitBackendAuthority
* 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.
......@@ -154,31 +138,6 @@ struct _PolkitBackendAuthorityClass
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,
GError **error);
gboolean (*add_authorization) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GError **error);
gboolean (*remove_authorization) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
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,
......@@ -195,6 +154,30 @@ struct _PolkitBackendAuthorityClass
void (*_polkit_reserved6) (void);
void (*_polkit_reserved7) (void);
void (*_polkit_reserved8) (void);
void (*_polkit_reserved9) (void);
void (*_polkit_reserved10) (void);
void (*_polkit_reserved11) (void);
void (*_polkit_reserved12) (void);
void (*_polkit_reserved13) (void);
void (*_polkit_reserved14) (void);
void (*_polkit_reserved15) (void);
void (*_polkit_reserved16) (void);
void (*_polkit_reserved17) (void);
void (*_polkit_reserved18) (void);
void (*_polkit_reserved19) (void);
void (*_polkit_reserved20) (void);
void (*_polkit_reserved21) (void);
void (*_polkit_reserved22) (void);
void (*_polkit_reserved23) (void);
void (*_polkit_reserved24) (void);
void (*_polkit_reserved25) (void);
void (*_polkit_reserved26) (void);
void (*_polkit_reserved27) (void);
void (*_polkit_reserved28) (void);
void (*_polkit_reserved29) (void);
void (*_polkit_reserved30) (void);
void (*_polkit_reserved31) (void);
void (*_polkit_reserved32) (void);
};
GType polkit_backend_authority_get_type (void) G_GNUC_CONST;
......@@ -211,14 +194,6 @@ GList *polkit_backend_authority_enumerate_actions (PolkitBackendAuthor
const gchar *locale,
GError **error);
GList *polkit_backend_authority_enumerate_users (PolkitBackendAuthority *authority,
PolkitSubject *caller,
GError **error);
GList *polkit_backend_authority_enumerate_groups (PolkitBackendAuthority *authority,
PolkitSubject *caller,
GError **error);
void polkit_backend_authority_check_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitSubject *subject,
......@@ -233,23 +208,6 @@ PolkitAuthorizationResult *polkit_backend_authority_check_authorization_finish (
GAsyncResult *res,
GError **error);
GList *polkit_backend_authority_enumerate_authorizations (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
GError **error);
gboolean polkit_backend_authority_add_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GError **error);
gboolean polkit_backend_authority_remove_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GError **error);
gboolean polkit_backend_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
const gchar *session_id,
......
......@@ -22,7 +22,6 @@ polkitd_1_SOURCES = \
polkitd_1_CFLAGS = \
-DPOLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
-DPOLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
-DG_LOG_DOMAIN=\"polkitd-1\" \
$(GLIB_CFLAGS) \
$(NULL)
......
NULL =
INCLUDES = \
-I$(top_builddir)/src \
-I$(top_srcdir)/src \
-I$(top_builddir)/src/polkit \
-I$(top_srcdir)/src/polkit \
-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
-DPACKAGE_LOCALSTATE_DIR=\""$(localstatedir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_LIB_DIR=\""$(libdir)"\" \
-D_POSIX_PTHREAD_SEMANTICS \
-D_REENTRANT \
-DEGG_DBUS_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
$(NULL)
lib_LTLIBRARIES=libpolkit-local-1.la
libpolkit_local_1includedir=$(includedir)/polkit-1/polkitlocal
libpolkit_local_1include_HEADERS = \
polkitlocal.h \
polkitlocaltypes.h \
polkitlocalauthority.h \
polkitlocalauthorization.h \
$(NULL)
libpolkit_local_1_la_SOURCES = \
polkitlocal.h \
polkitlocaltypes.h \
polkitlocalprivate.h \
polkitlocalauthority.c polkitlocalauthority.h \
polkitlocalauthorization.c polkitlocalauthorization.h \
$(NULL)
libpolkit_local_1_la_CFLAGS = \
-D_POLKIT_COMPILATION \
-D_POLKIT_LOCAL_COMPILATION \
$(GLIB_CFLAGS) \
$(EGG_DBUS_CFLAGS) \
$(NULL)
libpolkit_local_1_la_LIBADD = \
$(GLIB_LIBS) \
$(EGG_DBUS_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(EXPAT_LIBS) \
$(NULL)
clean-local :
rm -f *~
/*
* 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_LOCAL_H
#define __POLKIT_LOCAL_H
#if !defined (POLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE) && !defined (_POLKIT_LOCAL_COMPILATION)
#error "libpolkitlocal is unstable API and subject to change. You must define POLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE to acknowledge this."
#endif
#define _POLKIT_LOCAL_INSIDE_POLKIT_LOCAL_H 1
#include <polkitlocal/polkitlocaltypes.h>
#include <polkitlocal/polkitlocalauthority.h>
#include <polkitlocal/polkitlocalauthorization.h>
#undef _POLKIT_LOCAL_INSIDE_POLKIT_LOCAL_H
#endif /* __POLKIT_LOCAL_H */
This diff is collapsed.
/*
* 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>
*/
#if !defined (_POLKIT_LOCAL_COMPILATION) && !defined(_POLKIT_LOCAL_INSIDE_POLKIT_LOCAL_H)
#error "Only <polkitlocal/polkitlocal.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef __POLKIT_LOCAL_AUTHORITY_H
#define __POLKIT_LOCAL_AUTHORITY_H
#include <glib-object.h>
#include <gio/gio.h>
#include <polkitlocal/polkitlocaltypes.h>
G_BEGIN_DECLS
#define POLKIT_TYPE_LOCAL_AUTHORITY (polkit_local_authority_get_type())
#define POLKIT_LOCAL_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthority))
#define POLKIT_LOCAL_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthorityClass))
#define POLKIT_LOCAL_AUTHORITY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthorityClass))
#define POLKIT_IS_LOCAL_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_LOCAL_AUTHORITY))
#define POLKIT_IS_LOCAL_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_LOCAL_AUTHORITY))
#if 0
typedef struct _PolkitLocalAuthority PolkitLocalAuthority;
#endif
typedef struct _PolkitLocalAuthorityClass PolkitLocalAuthorityClass;
GType polkit_local_authority_get_type (void) G_GNUC_CONST;
PolkitLocalAuthority *polkit_local_authority_get (void);
/* ---------------------------------------------------------------------------------------------------- */
GList *polkit_local_authority_enumerate_users_sync (PolkitLocalAuthority *local_authority,
GCancellable *cancellable,
GError **error);
GList *polkit_local_authority_enumerate_groups_sync (PolkitLocalAuthority *local_authority,
GCancellable *cancellable,
GError **error);
GList *polkit_local_authority_enumerate_authorizations_sync (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
GCancellable *cancellable,
GError **error);
gboolean polkit_local_authority_add_authorization_sync (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GCancellable *cancellable,
GError **error);
gboolean polkit_local_authority_remove_authorization_sync (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GCancellable *cancellable,
GError **error);
/* ---------------------------------------------------------------------------------------------------- */
void polkit_local_authority_enumerate_users (PolkitLocalAuthority *local_authority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList * polkit_local_authority_enumerate_users_finish (PolkitLocalAuthority *local_authority,
GAsyncResult *res,
GError **error);
void polkit_local_authority_enumerate_groups (PolkitLocalAuthority *local_authority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList * polkit_local_authority_enumerate_groups_finish (PolkitLocalAuthority *local_authority,
GAsyncResult *res,
GError **error);
void polkit_local_authority_enumerate_authorizations (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList * polkit_local_authority_enumerate_authorizations_finish (PolkitLocalAuthority *local_authority,
GAsyncResult *res,
GError **error);
void polkit_local_authority_add_authorization (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean polkit_local_authority_add_authorization_finish (PolkitLocalAuthority *local_authority,
GAsyncResult *res,
GError **error);
void polkit_local_authority_remove_authorization (PolkitLocalAuthority *local_authority,
PolkitIdentity *identity,
PolkitLocalAuthorization *authorization,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean polkit_local_authority_remove_authorization_finish (PolkitLocalAuthority *local_authority,
GAsyncResult *res,
GError **error);
/* ---------------------------------------------------------------------------------------------------- */
G_END_DECLS
#endif /* __POLKIT_LOCAL_AUTHORITY_H */
/*
* 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 "polkitlocalauthorization.h"
#include "polkitprivate.h"
#include "polkitlocalprivate.h"
/**
* SECTION:polkitlocalauthorization
* @title: PolkitLocalAuthorization
* @short_description: Local Authorization
* @stability: Unstable
*
* Instances of this class represents authorizations for the local authority backend.
*
* To use this unstable API you need to define the symbol
* <literal>POLKIT_LOCAL_I_KNOW_API_IS_SUBJECT_TO_CHANGE</literal>.
*/
struct _PolkitLocalAuthorization
{