diff options
Diffstat (limited to 'autotests')
-rw-r--r-- | autotests/kconfigtest.cpp | 13 | ||||
-rw-r--r-- | autotests/kconfigtest.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 00e7bbf0..9f88e67b 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -16,6 +16,7 @@ #include <kdesktopfile.h> #include <qtemporarydir.h> +#include <kauthorized.h> #include <kconfiggroup.h> #include <kconfigwatcher.h> #include <ksharedconfig.h> @@ -2071,6 +2072,18 @@ void KConfigTest::testNotify() QCOMPARE(otherWatcherSpy[0][1].value<QByteArrayList>(), QByteArrayList({"someGlobalEntry"})); } +void KConfigTest::testKAuthorizeEnums() +{ + KSharedConfig::Ptr config = KSharedConfig::openConfig(); + KConfigGroup actionRestrictions = config->group("KDE Action Restrictions"); + actionRestrictions.writeEntry("shell_access", false); + actionRestrictions.writeEntry("action/open_with", false); + + QVERIFY(!KAuthorized::authorize(KAuthorized::SHELL_ACCESS)); + QVERIFY(!KAuthorized::authorizeAction(KAuthorized::OPEN_WITH)); + actionRestrictions.deleteGroup(); +} + void KConfigTest::testKdeglobalsVsDefault() { // Add testRestore key with global value in kdeglobals diff --git a/autotests/kconfigtest.h b/autotests/kconfigtest.h index f716bd70..cdc94366 100644 --- a/autotests/kconfigtest.h +++ b/autotests/kconfigtest.h @@ -82,6 +82,7 @@ private Q_SLOTS: void testNewlines(); void testXdgListEntry(); void testNotify(); + void testKAuthorizeEnums(); void testThreads(); |