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 crash when injection model has no mandatory fields defined
- Fix models created on parent entities can't be used on child entites
- Fix responsible group injection payload normalization so group remains visible in GLPI after import
- Fix plugin rights initialization and cleanup

## [2.15.4] - 2026-03-16

Expand Down
13 changes: 11 additions & 2 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ function plugin_datainjection_install()

if (!is_dir(PLUGIN_DATAINJECTION_UPLOAD_DIR)) {
@ mkdir(PLUGIN_DATAINJECTION_UPLOAD_DIR);

PluginDatainjectionProfile::createFirstAccess($_SESSION["glpiactiveprofile"]["id"]);
}

PluginDatainjectionProfile::createFirstAccess($_SESSION["glpiactiveprofile"]["id"]);

// Force reload of session profile rights
Session::reloadCurrentProfile();
break;

case 1:
Expand Down Expand Up @@ -199,6 +202,12 @@ function plugin_datainjection_uninstall()
}
}

// Remove plugin rights from all profiles
$profileRight = new ProfileRight();
foreach (PluginDatainjectionProfile::getAllRights() as $right) {
$profileRight->deleteByCriteria(['name' => $right['field']]);
}

if (is_dir(PLUGIN_DATAINJECTION_UPLOAD_DIR)) {
Toolbox::deleteDir(PLUGIN_DATAINJECTION_UPLOAD_DIR);
}
Expand Down
15 changes: 7 additions & 8 deletions inc/profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@ public static function createFirstAccess($profiles_id)
{

include_once Plugin::getPhpDir('datainjection') . "/inc/profile.class.php";
foreach (self::getAllRights() as $right) {
self::addDefaultProfileInfos(
$profiles_id,
['plugin_datainjection_model' => ALLSTANDARDRIGHT,
'plugin_datainjection_use' => READ,
],
);
}
self::addDefaultProfileInfos(
$profiles_id,
[
'plugin_datainjection_model' => ALLSTANDARDRIGHT,
'plugin_datainjection_use' => READ,
],
);
}

public static function migrateProfiles()
Expand Down