Jump to content

Access denied clicking on parent menu of customized sub menu


Recommended Posts

The BO menu is made of main pages, or tabs, (like "Preferences") which can contain a sub menu of sub tabs (like "General", "Orders", "Products", ...).

It seems that when you click on the parent tab, the action focuses on its first sub tab.

 

Now if I create a profile not allowed to access the first sub tab of a menu tab, when an employee with such profile clicks on the parent menu tab, the system raises an "Access denied" error.

 

It seems that the error raises simply because the parent does not focus on its first ACCESSIBLE sub tab but stubbornly on its first sub tab, accessible or not!

 

Can it be? 

Is there a way to set the "parent" focus?

 

Thank you.

Link to comment
Share on other sites

In fact, the trouble comes from this link:

<a href="{if $t.sub_tabs|@count && isset($t.sub_tabs[0].href)}{$t.sub_tabs[0].href}{else}{$t.href}{/if}" class="title" >
<i class="icon-{$t.class_name}"></i>
<span>{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</span>
</a>
inside admin/themes/default/template/nav.tpl
 
And in particular:
$t.sub_tabs[0]
Link to comment
Share on other sites

Workaround:

{if $t.sub_tabs|@count && reset($t.sub_tabs)}
	{assign var="first_k" value=key($t.sub_tabs)}
{/if}
<a href="{if $t.sub_tabs|@count && isset($t.sub_tabs[$first_k].href)}{$t.sub_tabs[$first_k].href}{else}{$t.href}{/if}" class="title" >
	<i class="icon-{$t.class_name}"></i>
	<span>{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</span>
</a>
Link to comment
Share on other sites

×
×
  • Create New...