From f05423c1d89419c692bb72d5a3c60e4874a0a5f2 Mon Sep 17 00:00:00 2001 From: MyuTsu Date: Fri, 4 Sep 2026 14:48:36 +0200 Subject: [PATCH] feat(Core): implement sudo mode --- CHANGELOG.md | 1 + inc/config.class.php | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc74e0e..affa574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - GLPI 12 compatibility +- Enable `sudo` mode for `Config` ### Fixed diff --git a/inc/config.class.php b/inc/config.class.php index b291aea..0c4671c 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -49,9 +49,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) public function showForm($ID = -1, array $options = []) { - if (!Session::haveRight(Config::$rightname, UPDATE)) { - return false; - } + (new Config())->checkGlobal(UPDATE); $config = self::getConfig(true); @@ -113,6 +111,11 @@ public static function configUpdate($input) return $input; // TODO: Change the autogenerated stub } + protected static function itemTypeRequiresReauthentication(): bool + { + return true; + } + public static function getIcon() { return 'fas fa-tablet-alt';