Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fix mandatory fields of a block hidden by its display conditions blocking the save of an item
- Fix fields values updates not applying the expected checks in some cases
- Fix `Yes/No` field values returned as strings instead of integers in search results
- Fix ticket observers being able to edit and save additional fields they are not allowed to modify

## [1.24.6] - 2026-10-06

Expand Down
15 changes: 15 additions & 0 deletions inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,21 @@ public static function preItemUpdate(CommonDBTM $item)
{
self::preItem($item);
if (array_key_exists('_plugin_fields_data', $item->input)) {
// Only save plugin fields if the user can update this specific item.
// Automated contexts (cron jobs, API without active profile) bypass this check.
if (
isset($_SESSION['glpiactiveprofile']['id'])
&& !$item->canUpdateItem()
) {
unset($item->input['_plugin_fields_data']);
Session::addMessageAfterRedirect(
__('You do not have the right to modify the fields of this item', 'fields'),
false,
WARNING,
);
return true;
}

$data = $item->input['_plugin_fields_data'];
$data['itemtype'] = $item::class;
$data['entities_id'] = $item->isEntityAssign() ? $item->getEntityID() : 0;
Expand Down
4 changes: 2 additions & 2 deletions inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public static function showForTabContainer($c_id, $item)
return null;
}

$canedit = $right > READ;
$canedit = $right > READ && ($item->isNewItem() || $item->canUpdateItem());

//get fields for this container
$field_obj = new self();
Expand Down Expand Up @@ -1213,7 +1213,7 @@ public static function prepareHtmlFields(
return null;
}

$canedit = $right > READ;
$canedit = $right > READ && ($item->isNewItem() || $item->canUpdateItem());

// Fill status overrides if needed
if (in_array($item->getType(), PluginFieldsStatusOverride::getStatusItemtypes())) {
Expand Down
Loading
Loading