KConfig 5.109.0
kauthorized.h
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 1997 Matthias Kalle Dalheimer <kalle@kde.org>
3 SPDX-FileCopyrightText: 1998, 1999 Waldo Bastian <bastian@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KAUTHORIZED_H
9#define KAUTHORIZED_H
10
11#include <kconfigcore_export.h>
12
13#include <QMetaEnum>
14#include <QObject>
15#include <QStringList>
16#include <QVariant>
17
18class QUrl;
19class QString;
20
29namespace KAuthorized
30{
31Q_NAMESPACE_EXPORT(KCONFIGCORE_EXPORT)
32
33
40 SHELL_ACCESS = 1, // if the user is authorized to open a shell or execute shell commands
41 GHNS,
42 // GUI behavior
47};
48Q_ENUM_NS(GenericRestriction)
49
50
55 OPEN_WITH = 1,
57
61};
62Q_ENUM_NS(GenericAction)
63
64
94KCONFIGCORE_EXPORT bool authorize(const QString &action);
95
104KCONFIGCORE_EXPORT bool authorize(GenericRestriction action);
105
131KCONFIGCORE_EXPORT bool authorizeAction(const QString &action);
132
139KCONFIGCORE_EXPORT bool authorizeAction(GenericAction action);
140
141#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 24)
167KCONFIGCORE_EXPORT
168KCONFIGCORE_DEPRECATED_VERSION(5, 24, "Use KAuthorized::authorizeAction(const QString&)")
169bool authorizeKAction(const QString &action);
170#endif
171
194KCONFIGCORE_EXPORT bool authorizeControlModule(const QString &menuId);
195
206KCONFIGCORE_EXPORT QStringList authorizeControlModules(const QStringList &menuIds);
207
208}
209
210#endif
The functions in this namespace provide the core of the Kiosk action restriction system; the KIO and ...
Definition kauthorized.h:30
bool authorizeControlModule(const QString &menuId)
Returns whether the user is permitted to use a certain control module.
QStringList authorizeControlModules(const QStringList &menuIds)
Determines which control modules from a list the user is permitted to use.
GenericAction
Definition kauthorized.h:54
@ SWITCH_APPLICATION_LANGUAGE
if the toolbar should be displayed in apps
Definition kauthorized.h:59
@ OPTIONS_SHOW_TOOLBAR
if mime-type accociations are allowed to be configured
Definition kauthorized.h:58
@ EDITFILETYPE
if the open-with menu should be shown for files etc.
Definition kauthorized.h:56
@ BOOKMARKS
if an action to switch the app language should be shown
Definition kauthorized.h:60
GenericRestriction
The enum values lower cased represent the action that is authorized For example the SHELL_ACCESS valu...
Definition kauthorized.h:39
@ LINEEDIT_REVEAL_PASSWORD
if the collaborative data sharing framework KNewStuff is authorized
Definition kauthorized.h:43
@ MOVABLE_TOOLBARS
if line edits should be allowed to display completions
Definition kauthorized.h:45
@ RUN_DESKTOP_FILES
if toolbars of of apps should be movable
Definition kauthorized.h:46
@ LINEEDIT_TEXT_COMPLETION
if typed characters in password fields can be made visible
Definition kauthorized.h:44