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 15 2025 06:45:15
Script start
Timing: Jan 15 2025 06:45:15
Module start 'content'
Timing: Jan 15 2025 06:45:17
Module end 'content'
Timing: Jan 15 2025 06:45:17
Script end

Main resources:

Total runtime1.4792 sec
Peak memory usage6,144.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 687.4141214.8047
Module start 'content' 0.00671.3422 902.21881,895.2656
Module end 'content' 1.34890.1303 2,797.4844639.8359
Script end 1.4791  3,437.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00700.4702210.0003
Check MTime0.00150.1024210.0001
Mysql Total
Database connection0.00090.062310.0009
Mysqli_queries1.378793.20561960.0070
Looping result0.00190.12791930.0000
Template Total1.452898.220.7264
Template load0.00320.214720.0016
Template processing1.449698.000520.7248
Template load and register function0.00120.082310.0012
states
state_id_array0.00090.061210.0009
state_identifier_array0.00150.103420.0008
Override
Cache load0.00290.1986280.0001
Sytem overhead
Fetch class attribute can translate value0.00150.102340.0004
Fetch class attribute name0.00220.146580.0003
XML
Image XML parsing0.00190.127240.0005
class_abstraction
Instantiating content class attribute0.00000.0015100.0000
General
dbfile0.00210.1394340.0001
String conversion0.00000.000430.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs