KAuth

Polkit1Backend.h
1 /*
2  SPDX-FileCopyrightText: 2008 Nicola Gigante <[email protected]>
3  SPDX-FileCopyrightText: 2009 Radek Novacek <[email protected]>
4  SPDX-FileCopyrightText: 2009-2010 Dario Freddi <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8 
9 #ifndef POLKIT1BACKEND_H
10 #define POLKIT1BACKEND_H
11 
12 #include "AuthBackend.h"
13 
14 #include <QEventLoop>
15 #include <QHash>
16 #include <QStringList>
17 
18 #include <PolkitQt1/Authority>
19 
20 class QByteArray;
21 
22 namespace KAuth
23 {
24 class Polkit1Backend : public AuthBackend
25 {
26  Q_OBJECT
27  Q_PLUGIN_METADATA(IID "org.kde.Polkit1Backend")
28  Q_INTERFACES(KAuth::AuthBackend)
29 
30 public:
31  Polkit1Backend();
32  ~Polkit1Backend() override;
33  void setupAction(const QString &) override;
34  void preAuthAction(const QString &action, QWidget *parent) override;
35  Action::AuthStatus authorizeAction(const QString &) override;
36  Action::AuthStatus actionStatus(const QString &) override;
37  QByteArray callerID() const override;
38  ExtraCallerIDVerificationMethod extraCallerIDVerificationMethod() const override;
39  virtual bool isCallerAuthorized(const QString &action, const QByteArray &callerID, const QVariantMap &details) override;
40  bool actionExists(const QString &action) override;
41  QVariantMap backendDetails(const DetailsMap &details) override;
42 
43 private Q_SLOTS:
44  void checkForResultChanged();
45 
46 private:
47  QHash<QString, Action::AuthStatus> m_cachedResults;
48 };
49 
50 } // namespace Auth
51 
52 #endif
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
AuthStatus
The three values set by authorization methods.
Definition: action.h:82
KCONFIGCORE_EXPORT bool authorizeAction(const QString &action)
Definition: action.cpp:18
Q_INTERFACES(...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:14:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.