[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.

eZ debug

Timing: Jan 29 2025 23:43:57
Script start
Timing: Jan 29 2025 23:43:57
Module start 'layout'
Timing: Jan 29 2025 23:43:57
Module start 'content'
Timing: Jan 29 2025 23:43:57
Module end 'content'
Timing: Jan 29 2025 23:43:57
Script end

Main resources:

Total runtime0.0189 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1250151.2109
Module start 'layout' 0.00570.0074 739.335936.6484
Module start 'content' 0.01310.0047 775.984498.2500
Module end 'content' 0.01780.0011 874.234437.9922
Script end 0.0189  912.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002211.7992140.0002
Check MTime0.00105.3174140.0001
Mysql Total
Database connection0.00094.767410.0009
Mysqli_queries0.007640.114530.0025
Looping result0.00000.064310.0000
Template Total0.00094.610.0009
Template load0.00073.566410.0007
Template processing0.00020.979010.0002
Override
Cache load0.00042.365410.0004
General
dbfile0.00137.091180.0002
String conversion0.00000.036640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs