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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8667 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-09-20 16:04:35 +00:00
parent b45dd02452
commit 92cc465a3c
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;
}
}