// 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user