From ae9047a64eabeb55589acbd3c03be3293cf1df62 Mon Sep 17 00:00:00 2001 From: mbressy Date: Thu, 3 Sep 2026 08:25:03 +0000 Subject: [PATCH 1/3] use config right to access container config form --- front/container.form.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/front/container.form.php b/front/container.form.php index 8b715f74..372b65b1 100644 --- a/front/container.form.php +++ b/front/container.form.php @@ -28,8 +28,6 @@ * ------------------------------------------------------------------------- */ -use Glpi\Exception\Http\AccessDeniedHttpException; - Session::checkLoginUser(); if (empty($_GET['id'])) { @@ -73,12 +71,9 @@ Html::back(); } else { - if ((int) $_GET['id'] > 0) { - $right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_GET['id']); - if ($right < READ) { - throw new AccessDeniedHttpException(); - } - } + // Admin config screen: gate with the standard "config" right, not the per-profile + // block-visibility right (which would let an admin lock himself out of the config). + $container->check((int) $_GET['id'] > 0 ? (int) $_GET['id'] : -1, READ); Html::header( __('Additional fields', 'fields'), From ae2070142e673699361d00ad3cbb89c5beee6608 Mon Sep 17 00:00:00 2001 From: mbressy Date: Thu, 3 Sep 2026 08:45:20 +0000 Subject: [PATCH 2/3] update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94a14fe6..d6bdf96b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Fixed + +- Fix administrators losing access to a block's configuration after setting a profile to "no access" on that block. + ## [1.24.5] - 2026-09-11 ### Fixed From 78e8ccdadd0e3294637ce452278400bbbdedea54 Mon Sep 17 00:00:00 2001 From: mbressy Date: Tue, 15 Sep 2026 14:14:48 +0000 Subject: [PATCH 3/3] import missing class --- front/container.form.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front/container.form.php b/front/container.form.php index 372b65b1..6b5dafa1 100644 --- a/front/container.form.php +++ b/front/container.form.php @@ -28,6 +28,8 @@ * ------------------------------------------------------------------------- */ +use Glpi\Exception\Http\AccessDeniedHttpException; + Session::checkLoginUser(); if (empty($_GET['id'])) {