Forums / Setup & design / Admin interface for "custom" editors

Admin interface for "custom" editors

Author Message

Rémi Goyard

Thursday 03 April 2008 12:01:48 am

Hi,
I have some contributors that will have to connect to the admin interface for managing content, but i just want them to see the "content structure" tab , and the media tab, i don't want them to SEE others.
Whith roles and policies, they just dont have access to other tabs but they can see it.
Is there a way to "hide" unaccessible tabs.
Some of others contributors may have acces to all tabs so i can not define hidden / shown tabs in menu.ini of my siteaccess.

Regards

rémi

Abdelkader RHOUATI

Thursday 03 April 2008 3:13:35 am

Hi,

On a project, I had the same need. I have chosen as a solution, to ovverride paglayout.tpl of design admin, and then Modify the code:

{* code for display the principal menu*}
{section var=Menu loop=topmenu($ui_context)}

    {include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}

{/section}

By this one:


{*define the user groups*}
{def $user=fetch( 'user', 'current_user' )}
{def $group_id = $user.contentobject.main_parent_node_id}

{section var=Menu loop=topmenu($ui_context)}

	{*test of the group of user*}
	{if eq($group_id,ezini('GroupeXXXXXX','GroupID','configuration.ini'))}	      
		{switch match=$Menu.url}
			   {case match="content/view/full/2"}{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}{/case}
			   {case match="content/draft"}{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}{/case}
			   {case}			     
			   {/case}
		{/switch}
	{else}

		{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}

	{/if}

{/section}

This code makes it possible to test if a user belongs to the group GroupXXXXX (defined in the file configuration.ini) if so, it shows just two menus; content structure and content draft.

i hope this will help you.

tks

Abdelkader.

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery