Skip to content

Commit 434fbd0

Browse files
author
Kopylova,Olga(okopylova)
committed
Merge pull request #383 from magento-extensibility/develop
[Extensibility] Sprint 53 Stories and Bugs
2 parents 378cab2 + fa1d472 commit 434fbd0

File tree

124 files changed

+1005
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1005
-355
lines changed

.htaccess

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@
6565
SecFilterScanPOST Off
6666
</IfModule>
6767

68-
<IfModule mod_headers.c>
69-
############################################
70-
## prevent clickjacking
71-
72-
Header set X-Frame-Options SAMEORIGIN
73-
</IfModule>
74-
7568
<IfModule mod_deflate.c>
7669

7770
############################################
@@ -187,4 +180,4 @@
187180
## If running in cluster environment, uncomment this
188181
## http://developer.yahoo.com/performance/rules.html#etags
189182

190-
#FileETag none
183+
#FileETag none

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ class Notification extends \Magento\Backend\App\AbstractAction
1414
*/
1515
protected function _isAllowed()
1616
{
17-
switch ($this->getRequest()->getActionName()) {
18-
case 'markAsRead':
19-
$acl = 'Magento_AdminNotification::mark_as_read';
20-
break;
21-
22-
case 'massMarkAsRead':
23-
$acl = 'Magento_AdminNotification::mark_as_read';
24-
break;
25-
26-
case 'remove':
27-
$acl = 'Magento_AdminNotification::adminnotification_remove';
28-
break;
29-
30-
case 'massRemove':
31-
$acl = 'Magento_AdminNotification::adminnotification_remove';
32-
break;
33-
34-
default:
35-
$acl = 'Magento_AdminNotification::show_list';
36-
}
37-
return $this->_authorization->isAllowed($acl);
17+
return $this->_authorization->isAllowed('Magento_AdminNotification::show_list');
3818
}
3919
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,12 @@ public function execute()
3636
}
3737
$this->_redirect('adminhtml/*/');
3838
}
39+
40+
/**
41+
* @return bool
42+
*/
43+
protected function _isAllowed()
44+
{
45+
return $this->_authorization->isAllowed('Magento_AdminNotification::mark_as_read');
46+
}
3947
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,12 @@ public function execute()
3838
}
3939
$this->_redirect('adminhtml/*/');
4040
}
41+
42+
/**
43+
* @return bool
44+
*/
45+
protected function _isAllowed()
46+
{
47+
return $this->_authorization->isAllowed('Magento_AdminNotification::mark_as_read');
48+
}
4149
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,12 @@ public function execute()
3333
}
3434
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
3535
}
36+
37+
/**
38+
* @return bool
39+
*/
40+
protected function _isAllowed()
41+
{
42+
return $this->_authorization->isAllowed('Magento_AdminNotification::adminnotification_remove');
43+
}
3644
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ public function execute()
3535
}
3636
$this->_redirect('adminhtml/*/');
3737
}
38+
39+
/**
40+
* @return bool
41+
*/
42+
protected function _isAllowed()
43+
{
44+
return $this->_authorization->isAllowed('Magento_AdminNotification::adminnotification_remove');
45+
}
3846
}

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,9 @@
122122
</argument>
123123
</arguments>
124124
</type>
125+
<type name="Magento\Framework\App\Response\XFrameOptPlugin">
126+
<arguments>
127+
<argument name="xFrameOpt" xsi:type="const">Magento\Framework\App\Response\XFrameOptPlugin::BACKEND_X_FRAME_OPT</argument>
128+
</arguments>
129+
</type>
125130
</config>

app/code/Magento/Sales/Controller/Adminhtml/Order.php

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -124,47 +124,10 @@ protected function _initOrder()
124124
}
125125

126126
/**
127-
* Acl check for admin
128-
*
129127
* @return bool
130-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
131128
*/
132129
protected function _isAllowed()
133130
{
134-
$action = strtolower($this->getRequest()->getActionName());
135-
switch ($action) {
136-
case 'hold':
137-
$aclResource = 'Magento_Sales::hold';
138-
break;
139-
case 'unhold':
140-
$aclResource = 'Magento_Sales::unhold';
141-
break;
142-
case 'email':
143-
$aclResource = 'Magento_Sales::email';
144-
break;
145-
case 'cancel':
146-
$aclResource = 'Magento_Sales::cancel';
147-
break;
148-
case 'view':
149-
$aclResource = 'Magento_Sales::actions_view';
150-
break;
151-
case 'addcomment':
152-
$aclResource = 'Magento_Sales::comment';
153-
break;
154-
case 'creditmemos':
155-
$aclResource = 'Magento_Sales::creditmemo';
156-
break;
157-
case 'reviewpayment':
158-
$aclResource = 'Magento_Sales::review_payment';
159-
break;
160-
case 'address':
161-
case 'addresssave':
162-
$aclResource = 'Magento_Sales::actions_edit';
163-
break;
164-
default:
165-
$aclResource = 'Magento_Sales::sales_order';
166-
break;
167-
}
168-
return $this->_authorization->isAllowed($aclResource);
131+
return $this->_authorization->isAllowed('Magento_Sales::sales_order');
169132
}
170133
}

app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,12 @@ public function execute()
5757
}
5858
return $this->resultRedirectFactory->create()->setPath('sales/*/');
5959
}
60+
61+
/**
62+
* @return bool
63+
*/
64+
protected function _isAllowed()
65+
{
66+
return $this->_authorization->isAllowed('Magento_Sales::comment');
67+
}
6068
}

app/code/Magento/Sales/Controller/Adminhtml/Order/Address.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,12 @@ public function execute()
3131
return $this->resultRedirectFactory->create()->setPath('sales/*/');
3232
}
3333
}
34+
35+
/**
36+
* @return bool
37+
*/
38+
protected function _isAllowed()
39+
{
40+
return $this->_authorization->isAllowed('Magento_Sales::actions_edit');
41+
}
3442
}

0 commit comments

Comments
 (0)