pluginsGLPI / genericobject

Genericobject object plugin
http://glpi-plugins.rtfd.io/en/latest/genericobject/index.html
GNU General Public License v3.0
53 stars 58 forks source link

Fix(Object): fix rightname computation #378

Closed stonebuzz closed 6 months ago

stonebuzz commented 6 months ago

In GLPI, objects ending with x (e.g. PAX) automatically have their table suffixed with es.

cf DbUtils::getPlural()

In GenericObject, the rightname computation follows part of this logic But the case of the object ending with x is missing.

An object PluginGenericObjectPax have a table like plugin_genericobject_paxes (OK) but rightname is compute as plugin_genericobject_paxs (NOK)

for classic use, with only the Genericobject plugin, rights management is OK

But when plugin fields create a container (from template) for PluginGenericObjectPax, bad rightname is used (plugin_genericobject_paxs)

And when datainjection plugin have to handle fields (from fields plugin) , plugin refuse to display related model because current user have no right (on plugin_genericobject_paxes but have on plugin_genericobject_paxs)