Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37860987
en ru br
ALT Linux repos
S:5.27.8-alt1

Group :: Graphical desktop/KDE
RPM: plasma5-welcome

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: alt-check-auth.patch
Download


--- a/src/contents/ui/pages/PowerfulWhenNeeded.qml
+++ b/src/contents/ui/pages/PowerfulWhenNeeded.qml
@@ -103,6 +103,7 @@ GenericPage {
                 subtitle: i18nc("@info Caption for Get Hot New Stuff button", "Extend the system with add-ons")
                 buttonIcon: "get-hot-new-stuff"
                 onClicked: pageStack.layers.push(ghnsView);
+                visible: Controller.isAuthorized("ghns");
             }
         }
 
--- a/src/contents/ui/main.qml
+++ b/src/contents/ui/main.qml
@@ -141,7 +141,9 @@ Kirigami.ApplicationWindow {
             }
 
             pageStack.push(contribute);
-            pageStack.push(donate);
+            if (Controller.isAuthorized("action/help_donate")) {
+                pageStack.push(donate);
+            }
             pageStack.currentIndex = 0;
         }
     }
--- a/src/controller.h
+++ b/src/controller.h
@@ -11,6 +11,7 @@ class Controller : public QObject
 {
     Q_OBJECT
 public:
+    Q_INVOKABLE bool isAuthorized(const QString &test_action);
     Q_INVOKABLE static void launchApp(const QString &program);
     Q_INVOKABLE static void runCommand(const QString &command);
     Q_INVOKABLE static void runCommand(const QString &command, const QString &desktopFilename);
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -19,6 +19,7 @@
 #include <KIO/CommandLauncherJob>
 #include <KNotificationJobUiDelegate>
 #include <KService>
+#include <KAuthorized>
 
 void Controller::launchApp(const QString &program)
 {
@@ -27,6 +28,11 @@ void Controller::launchApp(const QString
     job->start();
 }
 
+bool Controller::isAuthorized(const QString &test_action)
+{
+    return KAuthorized::authorize(test_action);
+}
+
 void Controller::runCommand(const QString &command)
 {
     runCommand(command, QString());
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin