diff --git a/CHANGELOG.md b/CHANGELOG.md index f7ff05c1..3ff962a3 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.4] - 2026-08-06 ### Fixed diff --git a/front/container.form.php b/front/container.form.php index adfb8a6b..73a59b37 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'])) { @@ -63,12 +61,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'),