Forums / General / [edit] NOT Bug in "drop down" menu

[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

eZ debug

Timing: Jan 29 2025 13:31:59
Script start
Timing: Jan 29 2025 13:31:59
Module start 'content'
Timing: Jan 29 2025 13:31:59
Module end 'content'
Timing: Jan 29 2025 13:31:59
Script end

Main resources:

Total runtime0.1321 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9219180.8438
Module start 'content' 0.00610.0051 768.7656101.9766
Module end 'content' 0.01120.1208 870.7422530.0781
Script end 0.1320  1,400.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.4736200.0002
Check MTime0.00130.9980200.0001
Mysql Total
Database connection0.00080.573110.0008
Mysqli_queries0.092970.32161410.0007
Looping result0.00100.73361390.0000
Template Total0.120391.110.1203
Template load0.00080.624710.0008
Template processing0.119590.471310.1195
Override
Cache load0.00060.423310.0006
Sytem overhead
Fetch class attribute can translate value0.00060.471710.0006
XML
Image XML parsing0.00020.174210.0002
General
dbfile0.00544.0803200.0003
String conversion0.00000.004530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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