Skip to content

Instantly share code, notes, and snippets.

@avoelkl
Last active December 2, 2015 10:44
Show Gist options
  • Save avoelkl/f99e95c8caad700aee9c to your computer and use it in GitHub Desktop.
Save avoelkl/f99e95c8caad700aee9c to your computer and use it in GitHub Desktop.
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
<?php
/**
* Created by PhpStorm.
* User: a.voelkl
* Date: 30.10.2015
* Time: 13:21
*/
/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
//---------------------------------------------------
// Add variables
//---------------------------------------------------
$installer->getConnection()->insertMultiple(
$installer->getTable('admin/permission_variable'),
array(
array('variable_name' => 'your/variable/name', 'is_allowed' => 1),
array('variable_name' => 'another/modules/configvariable', 'is_allowed' => 1),
)
);
//---------------------------------------------------
// Add blocks
//---------------------------------------------------
$installer->getConnection()->insertMultiple(
$installer->getTable('admin/permission_block'),
array(
array('block_name' => 'mymodule/myblock', 'is_allowed' => 1),
array('block_name' => 'anothermodule/blockname', 'is_allowed' => 1),
)
);
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment