// Creation of AdminController : Admin tabs will now extend this class (see AdminTools.php for example)

This commit is contained in:
tDidierjean
2011-09-20 16:04:35 +00:00
parent b556966762
commit 299f9ab066
33 changed files with 1316 additions and 46 deletions
+12
View File
@@ -240,4 +240,16 @@ class TabCore extends ObjectModel
WHERE `id_tab` = '.(int)$result[$i]['id_tab']);
return true;
}
public static function checkTabRights($id_tab)
{
static $tabAccesses = NULL;
if ($tabAccesses === NULL)
$tabAccesses = Profile::getProfileAccesses(Context::getContext()->employee->id_profile);
if (isset($tabAccesses[(int)($id_tab)]['view']))
return ($tabAccesses[(int)($id_tab)]['view'] === '1');
return false;
}
}