Modernize permission handling

This commit is contained in:
Curtis Conard
2024-05-13 06:21:53 -04:00
committed by Johan Cwiklinski
parent 9e17e9d8fa
commit bcdae86820
6 changed files with 99 additions and 59 deletions

View File

@ -85,8 +85,8 @@ function plugin_init_example() {
}
}
// Display a menu entry ?
$_SESSION["glpi_plugin_example_profile"]['example'] = 'w';
if (isset($_SESSION["glpi_plugin_example_profile"])) { // Right set in change_profile hook
Plugin::registerClass(\GlpiPlugin\Example\Profile::class, ['addtabon' => ['Profile']]);
if (Example::canView()) { // Right set in change_profile hook
$PLUGIN_HOOKS['menu_toadd']['example'] = ['plugins' => Example::class,
'tools' => Example::class];