summaryrefslogtreecommitdiff
path: root/src/polkitbackend/polkitbackendauthority.c
blob: 3de7e8aef34c5c086afe71489d132007ba10591b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
 * 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>
 */

#include "config.h"
#include <errno.h>
#include <pwd.h>
#include <string.h>
#include <polkit/polkit.h>
#include "polkitbackendauthority.h"

G_DEFINE_ABSTRACT_TYPE (PolkitBackendAuthority, polkit_backend_authority, G_TYPE_OBJECT);

static void
polkit_backend_authority_init (PolkitBackendAuthority *local_authority)
{
}

static void
polkit_backend_authority_class_init (PolkitBackendAuthorityClass *klass)
{
}

void
polkit_backend_authority_enumerate_actions (PolkitBackendAuthority   *authority,
                                            const gchar              *locale,
                                            PolkitBackendPendingCall *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->enumerate_actions (authority, locale, pending_call);
}

void
polkit_backend_authority_enumerate_users (PolkitBackendAuthority   *authority,
                                          PolkitBackendPendingCall *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->enumerate_users (authority, pending_call);
}

void
polkit_backend_authority_enumerate_groups (PolkitBackendAuthority   *authority,
                                           PolkitBackendPendingCall *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->enumerate_groups (authority, pending_call);
}

void
polkit_backend_authority_enumerate_sessions (PolkitBackendAuthority   *authority,
                                             PolkitBackendPendingCall *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->enumerate_sessions (authority, pending_call);
}

void
polkit_backend_authority_check_authorization (PolkitBackendAuthority        *authority,
                                              PolkitSubject                 *subject,
                                              const gchar                   *action_id,
                                              PolkitCheckAuthorizationFlags  flags,
                                              PolkitBackendPendingCall      *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->check_authorization (authority, subject, action_id, flags, pending_call);
}

void
polkit_backend_authority_enumerate_authorizations  (PolkitBackendAuthority    *authority,
                                                    PolkitSubject             *subject,
                                                    PolkitBackendPendingCall  *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->enumerate_authorizations (authority, subject, pending_call);
}

void
polkit_backend_authority_add_authorization  (PolkitBackendAuthority    *authority,
                                             PolkitAuthorization       *authorization,
                                             PolkitBackendPendingCall  *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->add_authorization (authority, authorization, pending_call);
}

void
polkit_backend_authority_remove_authorization  (PolkitBackendAuthority    *authority,
                                                PolkitAuthorization       *authorization,
                                                PolkitBackendPendingCall  *pending_call)
{
  PolkitBackendAuthorityClass *klass;

  klass = POLKIT_BACKEND_AUTHORITY_GET_CLASS (authority);

  klass->remove_authorization (authority, authorization, pending_call);
}