diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -1466,11 +1466,14 @@ } void ShellCorona::evaluateScript(const QString &script) { - if (immutability() == Plasma::Types::SystemImmutable) { - if (calledFromDBus()) { + if (calledFromDBus()) { + if (immutability() == Plasma::Types::SystemImmutable) { sendErrorReply(QDBusError::Failed, QStringLiteral("Widgets are locked")); + return; + } else if (!KAuthorized::authorize(QStringLiteral("plasma-desktop/scripting_console"))) { + sendErrorReply(QDBusError::Failed, QStringLiteral("Administrative policies prevent script execution")); + return; } - return; } WorkspaceScripting::ScriptEngine scriptEngine(this);