Skip to content

Commit 474e416

Browse files
committed
Solve admin user roles resources issue
1 parent 37d3397 commit 474e416

File tree

16 files changed

+129
-6
lines changed

16 files changed

+129
-6
lines changed

Controller/Adminhtml/Faq/Delete.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414

1515
class Delete extends \Mageprince\Faq\Controller\Adminhtml\Faq
1616
{
17+
/**
18+
* {@inheritdoc}
19+
*/
20+
public function _isAllowed()
21+
{
22+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
23+
}
24+
1725
/**
1826
* Delete action
1927
*

Controller/Adminhtml/Faq/Edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ public function __construct(
4545
parent::__construct($context, $coreRegistry);
4646
}
4747

48+
/**
49+
* {@inheritdoc}
50+
*/
51+
public function _isAllowed()
52+
{
53+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
54+
}
55+
4856
/**
4957
* Edit action
5058
*

Controller/Adminhtml/Faq/Index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ public function __construct(
3131
parent::__construct($context);
3232
}
3333

34+
/**
35+
* {@inheritdoc}
36+
*/
37+
public function _isAllowed()
38+
{
39+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
40+
}
41+
3442
/**
3543
* Index action
3644
*

Controller/Adminhtml/Faq/InlineEdit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ public function __construct(
3636
$this->jsonFactory = $jsonFactory;
3737
}
3838

39+
/**
40+
* {@inheritdoc}
41+
*/
42+
public function _isAllowed()
43+
{
44+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
45+
}
46+
3947
/**
4048
* Inline edit action
4149
*

Controller/Adminhtml/Faq/MassDelete.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ class MassDelete extends \Magento\Backend\App\Action
1818
/**
1919
* @var \Magento\Ui\Component\MassAction\Filter $filter
2020
*/
21-
private $filter;
21+
protected $filter;
2222

2323
/**
2424
* @var \Mageprince\Faq\Model\ResourceModel\Faq\CollectionFactory
2525
*/
26-
private $collectionFactory;
27-
26+
protected $collectionFactory;
27+
28+
/**
29+
* MassDelete constructor.
30+
* @param \Magento\Ui\Component\MassAction\Filter $filter
31+
* @param \Mageprince\Faq\Model\ResourceModel\Faq\CollectionFactory $collectionFactory
32+
* @param \Magento\Backend\App\Action\Context $context
33+
*/
2834
public function __construct(
2935
\Magento\Ui\Component\MassAction\Filter $filter,
3036
\Mageprince\Faq\Model\ResourceModel\Faq\CollectionFactory $collectionFactory,
@@ -35,6 +41,14 @@ public function __construct(
3541
parent::__construct($context);
3642
}
3743

44+
/**
45+
* {@inheritdoc}
46+
*/
47+
public function _isAllowed()
48+
{
49+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
50+
}
51+
3852
public function execute()
3953
{
4054
try {

Controller/Adminhtml/Faq/NewAction.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ public function __construct(
3131
parent::__construct($context, $coreRegistry);
3232
}
3333

34+
/**
35+
* {@inheritdoc}
36+
*/
37+
public function _isAllowed()
38+
{
39+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
40+
}
41+
3442
/**
3543
* New action
3644
*

Controller/Adminhtml/Faq/Save.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public function __construct(
3535
parent::__construct($context);
3636
}
3737

38+
/**
39+
* {@inheritdoc}
40+
*/
41+
public function _isAllowed()
42+
{
43+
return $this->_authorization->isAllowed('Mageprince_Faq::Faq');
44+
}
45+
3846
/**
3947
* Save action
4048
*

Controller/Adminhtml/FaqGroup/Delete.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
class Delete extends \Mageprince\Faq\Controller\Adminhtml\FaqGroup
1616
{
17+
/**
18+
* {@inheritdoc}
19+
*/
20+
public function _isAllowed()
21+
{
22+
return $this->_authorization->isAllowed('Mageprince_Faq::FaqGroup');
23+
}
1724

1825
/**
1926
* Delete action

Controller/Adminhtml/FaqGroup/Edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ public function __construct(
4242
parent::__construct($context, $coreRegistry);
4343
}
4444

45+
/**
46+
* {@inheritdoc}
47+
*/
48+
public function _isAllowed()
49+
{
50+
return $this->_authorization->isAllowed('Mageprince_Faq::FaqGroup');
51+
}
52+
4553
/**
4654
* Edit action
4755
*

Controller/Adminhtml/FaqGroup/Index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ public function __construct(
3434
parent::__construct($context);
3535
}
3636

37+
/**
38+
* {@inheritdoc}
39+
*/
40+
public function _isAllowed()
41+
{
42+
return $this->_authorization->isAllowed('Mageprince_Faq::FaqGroup');
43+
}
44+
3745
/**
3846
* Index action
3947
*

0 commit comments

Comments
 (0)