Add hook to GLPI's inventory process #413
pkhr90
started this conversation in
Ideas and feature requests
Replies: 1 comment
|
I have opened a PR here: glpi-project/glpi#24839 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In multi-entity/multi-tenancy environments, incorrectly configured entity rules can cause imported assets to be assigned to the wrong entity during the inventory process.
To address this shortcoming, we suggest adding an extension point within GLPI's inventory process for plugins to adjust or validate the computed entity based on additional context or business logic.
Concretely, we propose exposing a hook in the
handle()function of theMainAssetclass.This hook would allow plugins to override the entity assigned by the entity rules before the asset is finally processed and stored, providing a safety mechanism when the standard rules are misconfigured.
In our specific use case, a plugin would replace the assigned entity with the entity associated with the authenticated user sending the inventory data to the central GLPI instance, ensuring consistency and preventing wrong assignments in multi-entity deployments.
All reactions