[edit] NOT Bug in "drop down" menu

Author Message

Håvard Bergersen

Wednesday 26 May 2010 1:06:05 am

The drop down menu you get when clicking on the icon of the object i admin2 is not considering the rights of the current user.. I get all the classes, and all though i am not able to create objects i still see all the classes available..

Is there a quick fix to this problem? Do the ez guys know about this?

http://twitpic.com/1r6831

André R.

Wednesday 26 May 2010 2:02:34 am

This is actually by design, you can change it with [TreeMenu]CreateHereMenu=full in contentstructuremenu.ini.

Ref:

# The "Create here" menu when clicking the node icon in the administrator interface.
#   disabled   - Not having the menu.
#   full       - Having the menu with the necessary permission checks - this will most likely slow down the interface.
#   simplified - Having the menu without the necessary permission checks
#                (in other words: the menu will include all classes regardless
#                 if the logged in user is allowed to create all those classes at that exact location).
#                Some users might get ACCESS DENIED, but it might just work for the most typical/usual cases
#                (where only one admin or a bunch of admins without limitations are using the interface).
CreateHereMenu=simplified

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Håvard Bergersen

Wednesday 26 May 2010 2:33:39 am

Aaaahhhhh.. :)

Thanks André, did not know this...

Andy Caiger

Tuesday 14 June 2011 12:42:42 am

I've just tried this in the latest version (eZ Publish Community 2011.5) and it makes matters even worse!

Using a user account that can create content (it has the 'Editor' role), the 'Create Here' menu ends up with no items. Also, the 'Create New' drop-down menu is empty too. But if I add a policy 'content/create/*' to the role, both these menus get fully populated.

It seems that the following fetch in children_detailed.tpl is the culprit:

 
{def $can_create_classes = fetch( 'content', 'can_instantiate_class_list', hash( 'parent_node', $node,
                                                                                     'filter_type', 'exclude',
                                                                                     'group_id', $group_id,
                                                                                     'group_by_class_group', true() ) )}

If the user has the policy 'content/create/*' then it returns a list of class groups, but if any other kind of content/create then it returns nothing! Any ideas? Is this a bug? How to fix it?

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

Andy Caiger

Thursday 16 June 2011 11:54:13 pm

Am I right in thinking that there is a bug in the fetch code?

Anyway, we fixed the problem by replacing it with code from the ezwt extension.

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

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