Skip to content

Commit 951fef1

Browse files
author
olysenko
committed
MAGETWO-62764: Add ACl resource
1 parent bf36a46 commit 951fef1

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Activate.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
namespace Magento\Analytics\Controller\Adminhtml\Subscription;
88

9-
109
use Magento\Analytics\Model\Subscription;
11-
use Magento\Framework\App\Action\Action;
10+
use Magento\Backend\App\Action;
1211
use Magento\Backend\App\Action\Context;
1312
use Magento\Framework\Controller\Result\Json;
1413
use Magento\Framework\Controller\ResultFactory;
@@ -44,6 +43,16 @@ public function __construct(
4443
parent::__construct($context);
4544
}
4645

46+
/**
47+
* Check admin permissions for this controller
48+
*
49+
* @return boolean
50+
*/
51+
protected function _isAllowed()
52+
{
53+
return $this->_authorization->isAllowed('Magento_Analytics::analytics');
54+
}
55+
4756
/**
4857
* Activate subscription to Magento Analytics via AJAX.
4958
*

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?php
22
/**
3-
* Copyright © 2016 Magento. All rights reserved.
3+
* Copyright © 2017 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66

77
namespace Magento\Analytics\Controller\Adminhtml\Subscription;
88

9-
109
use Magento\Analytics\Model\NotificationTime;
11-
use Magento\Framework\App\Action\Action;
10+
use Magento\Backend\App\Action;
1211
use Magento\Backend\App\Action\Context;
1312
use Magento\Framework\Intl\DateTimeFactory;
1413
use Magento\Framework\Controller\Result\Json;
@@ -57,6 +56,16 @@ public function __construct(
5756

5857
}
5958

59+
/**
60+
* Check admin permissions for this controller
61+
*
62+
* @return boolean
63+
*/
64+
protected function _isAllowed()
65+
{
66+
return $this->_authorization->isAllowed('Magento_Analytics::analytics');
67+
}
68+
6069
/**
6170
* Postpones notification about subscription
6271
*

app/code/Magento/Analytics/etc/acl.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
<resource id="Magento_Analytics::analytics" title="Analytics" translate="title" sortOrder="10">
1313
<resource id="Magento_Analytics::analytics_api" title="API" translate="title" sortOrder="10"/>
1414
</resource>
15+
<resource id="Magento_Backend::stores">
16+
<resource id="Magento_Backend::stores_settings">
17+
<resource id="Magento_Config::config" title="Configuration" translate="title" sortOrder="20">
18+
<resource id="Magento_Config::analytics" title="Analytics" translate="title" sortOrder="150" />
19+
</resource>
20+
</resource>
21+
</resource>
1522
</resource>
1623
</resources>
1724
</acl>

0 commit comments

Comments
 (0)