File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212- Fix crash when injection model has no mandatory fields defined
1313- Fix models created on parent entities can't be used on child entites
1414- Fix responsible group injection payload normalization so group remains visible in GLPI after import
15+ - Fix plugin rights initialization and cleanup
1516
1617## [ 2.15.4] - 2026-03-16
1718
Original file line number Diff line number Diff line change @@ -114,9 +114,12 @@ function plugin_datainjection_install()
114114
115115 if (!is_dir (PLUGIN_DATAINJECTION_UPLOAD_DIR )) {
116116 @ mkdir (PLUGIN_DATAINJECTION_UPLOAD_DIR );
117-
118- PluginDatainjectionProfile::createFirstAccess ($ _SESSION ["glpiactiveprofile " ]["id " ]);
119117 }
118+
119+ PluginDatainjectionProfile::createFirstAccess ($ _SESSION ["glpiactiveprofile " ]["id " ]);
120+
121+ // Force reload of session profile rights
122+ Session::reloadCurrentProfile ();
120123 break ;
121124
122125 case 1 :
@@ -199,6 +202,12 @@ function plugin_datainjection_uninstall()
199202 }
200203 }
201204
205+ // Remove plugin rights from all profiles
206+ $ profileRight = new ProfileRight ();
207+ foreach (PluginDatainjectionProfile::getAllRights () as $ right ) {
208+ $ profileRight ->deleteByCriteria (['name ' => $ right ['field ' ]]);
209+ }
210+
202211 if (is_dir (PLUGIN_DATAINJECTION_UPLOAD_DIR )) {
203212 Toolbox::deleteDir (PLUGIN_DATAINJECTION_UPLOAD_DIR );
204213 }
Original file line number Diff line number Diff line change @@ -126,14 +126,13 @@ public static function createFirstAccess($profiles_id)
126126 {
127127
128128 include_once Plugin::getPhpDir ('datainjection ' ) . "/inc/profile.class.php " ;
129- foreach (self ::getAllRights () as $ right ) {
130- self ::addDefaultProfileInfos (
131- $ profiles_id ,
132- ['plugin_datainjection_model ' => ALLSTANDARDRIGHT ,
133- 'plugin_datainjection_use ' => READ ,
134- ],
135- );
136- }
129+ self ::addDefaultProfileInfos (
130+ $ profiles_id ,
131+ [
132+ 'plugin_datainjection_model ' => ALLSTANDARDRIGHT ,
133+ 'plugin_datainjection_use ' => READ ,
134+ ],
135+ );
137136 }
138137
139138 public static function migrateProfiles ()
You can’t perform that action at this time.
0 commit comments