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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:20:21
Script start
Timing: Jan 18 2025 16:20:21
Module start 'layout'
Timing: Jan 18 2025 16:20:21
Module start 'content'
Timing: Jan 18 2025 16:20:22
Module end 'content'
Timing: Jan 18 2025 16:20:22
Script end

Main resources:

Total runtime0.7962 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.4453152.6250
Module start 'layout' 0.00700.0026 742.070339.4453
Module start 'content' 0.00950.7851 781.5156524.7656
Module end 'content' 0.79460.0016 1,306.281312.1563
Script end 0.7962  1,318.4375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3963160.0002
Check MTime0.00130.1596160.0001
Mysql Total
Database connection0.00170.215810.0017
Mysqli_queries0.748093.9446540.0139
Looping result0.00050.0635520.0000
Template Total0.766696.320.3833
Template load0.00190.238920.0010
Template processing0.764796.039720.3823
Template load and register function0.00020.030010.0002
states
state_id_array0.00080.104610.0008
state_identifier_array0.00070.090120.0004
Override
Cache load0.00160.1960220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.073620.0003
Fetch class attribute name0.00120.146430.0004
XML
Image XML parsing0.00090.109120.0004
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00120.1456160.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs