1 /*
2  * Copyright (C) 2008 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General
15  * Public License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  * Author: David Zeuthen <davidz@redhat.com>
20  */
21 
22 #if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H)
23 #error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents."
24 #endif
25 
26 #ifndef __POLKIT_IMPLICIT_AUTHORIZATION_H
27 #define __POLKIT_IMPLICIT_AUTHORIZATION_H
28 
29 #include <glib-object.h>
30 
31 G_BEGIN_DECLS
32 
33 /**
34  * PolkitImplicitAuthorization:
35  * @POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN: Unknown whether the subject is authorized, never returned in any public API.
36  * @POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED: Subject is not authorized.
37  * @POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED: Authentication is required.
38  * @POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED: Authentication as an administrator is required.
39  * @POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED_RETAINED: Authentication is required. If the authorization is obtained, it is retained.
40  * @POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED_RETAINED: Authentication as an administrator is required. If the authorization is obtained, it is retained.
41  * @POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED: The subject is authorized
42  *
43  * Possible implicit authorizations.
44  */
45 typedef enum
46 {
47   POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN = -1,
48   POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED = 0,
49   POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED = 1,
50   POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED = 2,
51   POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED_RETAINED = 3,
52   POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED_RETAINED = 4,
53   POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED = 5,
54 } PolkitImplicitAuthorization;
55 
56 const gchar                 *polkit_implicit_authorization_to_string   (PolkitImplicitAuthorization implicit_authorization);
57 
58 gboolean                     polkit_implicit_authorization_from_string (const gchar *string,
59                                                                         PolkitImplicitAuthorization *out_implicit_authorization);
60 
61 
62 G_END_DECLS
63 
64 #endif /* __POLKIT_IMPLICIT_AUTHORIZATION_H */
65