1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager -- Network link manager
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Copyright (C) 2014 Red Hat, Inc.
21 #ifndef NM_AUTH_MANAGER_H
22 #define NM_AUTH_MANAGER_H
25 #include "nm-default.h"
26 #include "nm-auth-subject.h"
31 #define NM_TYPE_AUTH_MANAGER (nm_auth_manager_get_type ())
32 #define NM_AUTH_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AUTH_MANAGER, NMAuthManager))
33 #define NM_AUTH_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AUTH_MANAGER, NMAuthManagerClass))
34 #define NM_IS_AUTH_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_AUTH_MANAGER))
35 #define NM_IS_AUTH_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_AUTH_MANAGER))
36 #define NM_AUTH_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AUTH_MANAGER, NMAuthManagerClass))
39 #define NM_AUTH_MANAGER_POLKIT_ENABLED "polkit-enabled"
41 #define NM_AUTH_MANAGER_SIGNAL_CHANGED "changed"
51 GType nm_auth_manager_get_type (void);
53 NMAuthManager *nm_auth_manager_setup (gboolean polkit_enabled);
54 NMAuthManager *nm_auth_manager_get (void);
56 gboolean nm_auth_manager_get_polkit_enabled (NMAuthManager *self);
60 void nm_auth_manager_polkit_authority_check_authorization (NMAuthManager *self,
61 NMAuthSubject *subject,
62 const char *action_id,
63 gboolean allow_user_interaction,
64 GCancellable *cancellable,
65 GAsyncReadyCallback callback,
67 gboolean nm_auth_manager_polkit_authority_check_authorization_finish (NMAuthManager *self,
69 gboolean *out_is_authorized,
70 gboolean *out_is_challenge,
77 #endif /* NM_AUTH_MANAGER_H */