Skip to content

Commit

Permalink
Acl corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
roma84 committed Jun 30, 2016
1 parent 6c7b17d commit 56d73ca
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 33 deletions.
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Index/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

class Delete extends \Magento\Backend\App\Action
{
/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::delete';
/**
* Core registry
*
Expand All @@ -20,13 +24,6 @@ public function __construct(\Magento\Backend\App\Action\Context $context,
$this->_coreRegistry = $coreRegistry;
parent::__construct($context);
}
/**
* {@inheritdoc}
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Swissup_Easytabs::delete');
}
/**
* Delete action
*
Expand Down
12 changes: 4 additions & 8 deletions Controller/Adminhtml/Index/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

class Edit extends Action
{
/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::easytabs';
/**
* Core registry
*
Expand Down Expand Up @@ -32,14 +36,6 @@ public function __construct(
parent::__construct($context);
}

/**
* {@inheritdoc}
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Swissup_Easytabs::save');
}

/**
* Init actions
*
Expand Down
4 changes: 4 additions & 0 deletions Controller/Adminhtml/Index/MassDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*/
class MassDelete extends \Magento\Backend\App\Action
{
/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::delete';
/**
* @var Filter
*/
Expand Down
5 changes: 5 additions & 0 deletions Controller/Adminhtml/Index/MassDisable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class MassDisable extends AbstractMassStatus
*/
const ID_FIELD = 'tab_id';

/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::status';

/**
* Resource collection
*
Expand Down
5 changes: 5 additions & 0 deletions Controller/Adminhtml/Index/MassEnable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class MassEnable extends AbstractMassStatus
*/
const ID_FIELD = 'tab_id';

/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::status';

/**
* Resource collection
*
Expand Down
12 changes: 4 additions & 8 deletions Controller/Adminhtml/Index/NewAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

class NewAction extends \Magento\Backend\App\Action
{
/**
* Admin resource
*/
const ADMIN_RESOURCE = 'Swissup_Easytabs::save';
/**
* @var \Magento\Backend\Model\View\Result\Forward
*/
Expand All @@ -20,14 +24,6 @@ public function __construct(
parent::__construct($context);
}

/**
* {@inheritdoc}
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Swissup_Easytabs::save');
}

/**
* Forward to edit
*
Expand Down
7 changes: 2 additions & 5 deletions Controller/Adminhtml/Index/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
class Save extends \Magento\Backend\App\Action
{
/**
* {@inheritdoc}
* Admin resource
*/
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Swissup_Easytabs::save');
}
const ADMIN_RESOURCE = 'Swissup_Easytabs::save';

/**
* Save action
Expand Down
12 changes: 7 additions & 5 deletions etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Swissup_Core::swissup">
<resource id="Swissup_Easytabs::easytabs" title="Easy Tabs" sortOrder="0">
<resource id="Swissup_Easytabs::save" title="Save" sortOrder="10" />
<resource id="Swissup_Easytabs::delete" title="Delete" sortOrder="20" />
<resource id="Swissup_Easytabs::status" title="Change Status" sortOrder="30" />
<resource id="Swissup_Core::swissup" title="Swissup">
<resource id="Swissup_Core::general" title="General">
<resource id="Swissup_Easytabs::easytabs" title="Easy Tabs" sortOrder="0">
<resource id="Swissup_Easytabs::save" title="Save" sortOrder="10" />
<resource id="Swissup_Easytabs::delete" title="Delete" sortOrder="20" />
<resource id="Swissup_Easytabs::status" title="Change Status" sortOrder="30" />
</resource>
</resource>
</resource>
</resource>
Expand Down

0 comments on commit 56d73ca

Please sign in to comment.