Last active
August 29, 2015 14:19
-
-
Save IvanChepurnyi/173f7fbe5bb31f47c0a4 to your computer and use it in GitHub Desktop.
<remove /> strange behaviour, with core acl="" attribute for layout file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This code allows all calls to <remove /> being ignored | |
// if a block with acl attribute is valid for admin user. | |
// Shall I keep it in LayoutCompiler? IMO, this looks more like a bug, than a needed feature! | |
foreach ($ignoreNodes as $block) { | |
if ($block->getAttribute('ignore') !== null) { | |
continue; | |
} | |
$acl = (string)$attributes->acl; | |
if ($acl && Mage::getSingleton('admin/session')->isAllowed($acl)) { | |
continue; | |
} | |
if (!isset($block->attributes()->ignore)) { | |
$block->addAttribute('ignore', true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment