Commit f23aeb68 authored by David Zeuthen's avatar David Zeuthen

Add a GPermission implementation

Based on code from Matthias Clasen <mclasen@redhat.com>.
Signed-off-by: 's avatarDavid Zeuthen <davidz@redhat.com>
parent 85f6ffbb
......@@ -73,6 +73,7 @@
<xi:include href="xml/polkiterror.xml"/>
<xi:include href="xml/polkitactiondescription.xml"/>
<xi:include href="xml/polkittemporaryauthorization.xml"/>
<xi:include href="xml/polkitpermission.xml"/>
<chapter id="subjects">
<title>Subjects</title>
<xi:include href="xml/polkitsubject.xml"/>
......
......@@ -468,3 +468,22 @@ POLKIT_TEMPORARY_AUTHORIZATION_CLASS
POLKIT_TEMPORARY_IS_AUTHORIZATION_CLASS
POLKIT_TEMPORARY_AUTHORIZATION_GET_CLASS
</SECTION>
<SECTION>
<FILE>polkitpermission</FILE>
PolkitPermission
polkit_permission_new
polkit_permission_new_finish
polkit_permission_new_sync
polkit_permission_get_action_id
polkit_permission_get_subject
<SUBSECTION Standard>
PolkitPermissionClass
POLKIT_PERMISSION
POLKIT_IS_PERMISSION
POLKIT_TYPE_PERMISSION
polkit_permission_get_type
POLKIT_PERMISSION_CLASS
POLKIT_IS_PERMISSION_CLASS
POLKIT_PERMISSION_GET_CLASS
</SECTION>
......@@ -13,6 +13,7 @@ polkit_system_bus_name_get_type
polkit_error_get_type
polkit_authorization_result_get_type
polkit_temporary_authorization_get_type
polkit_permission_get_type
polkit_backend_authority_get_type
polkit_backend_interactive_authority_get_type
......
......@@ -55,6 +55,7 @@ libpolkit_gobject_1include_HEADERS = \
polkitcheckauthorizationflags.h \
polkitimplicitauthorization.h \
polkittemporaryauthorization.h \
polkitpermission.h \
$(NULL)
libpolkit_gobject_1_la_SOURCES = \
......@@ -76,6 +77,7 @@ libpolkit_gobject_1_la_SOURCES = \
polkitcheckauthorizationflags.c polkitcheckauthorizationflags.h \
polkitimplicitauthorization.c polkitimplicitauthorization.h \
polkittemporaryauthorization.c polkittemporaryauthorization.h \
polkitpermission.c polkitpermission.h \
$(NULL)
libpolkit_gobject_1_la_CFLAGS = \
......
......@@ -42,6 +42,7 @@
#include <polkit/polkitauthority.h>
#include <polkit/polkitdetails.h>
#include <polkit/polkittemporaryauthorization.h>
#include <polkit/polkitpermission.h>
#undef _POLKIT_INSIDE_POLKIT_H
......
This diff is collapsed.
/*
* Copyright (C) 2008-2010 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: Matthias Clasen <mclasen@redhat.com>
* David Zeuthen <davidz@redhat.com>
*/
#if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H)
#error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef __POLKIT_PERMISSION_H
#define __POLKIT_PERMISSION_H
#include <polkit/polkittypes.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define POLKIT_TYPE_PERMISSION (polkit_permission_get_type ())
#define POLKIT_PERMISSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_PERMISSION, PolkitPermission))
#define POLKIT_IS_PERMISSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_PERMISSION))
GType polkit_permission_get_type (void) G_GNUC_CONST;
void polkit_permission_new (const gchar *action_id,
PolkitSubject *subject,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GPermission *polkit_permission_new_finish (GAsyncResult *res,
GError **error);
GPermission *polkit_permission_new_sync (const gchar *action_id,
PolkitSubject *subject,
GCancellable *cancellable,
GError **error);
const gchar *polkit_permission_get_action_id (PolkitPermission *permission);
PolkitSubject *polkit_permission_get_subject (PolkitPermission *permission);
G_END_DECLS
#endif /* __POLKIT_PERMISSION_H */
......@@ -58,4 +58,7 @@ typedef struct _PolkitDetails PolkitDetails;
struct _PolkitTemporaryAuthorization;
typedef struct _PolkitTemporaryAuthorization PolkitTemporaryAuthorization;
struct _PolkitPermission;
typedef struct _PolkitPermission PolkitPermission;
#endif /* __POLKIT_TYPES_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment