Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 699d7a1

Browse files
author
Oleksii Korshenko
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#13337: Add missing PHPDocs for methods (by @akiojalehto) - magento/magento2#13356: Fix incorrect @return tag (by @akiojalehto) - magento-engcom/magento2ce#1353: [EngCom Team] Batch 30. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1343: Forward Ports of Partners Contribution (by @vkublytskyi) Fixed GitHub Issues: - magento/magento2#4248: Validations not working on customer registration on DOB field. (reported by @skmomemo) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#6350: Frontend: Datepicker/calendar control does not use the store locale (reported by @heldchen) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#6712: Footer Links Widget CSS Issue (reported by @crtsl) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#6831: Magento 2.1.1 Invalid input date format 'Invalid date' (reported by @Nerogee) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#6858: DatePicker date format does not reflect user's locale (reported by @qubaji) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#9008: Error Message Is Confusing When Code Base Is Behind Database Module Version (reported by @mpchadwick) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#9151: Sitemap.xml: lastmod timestamp can contain invalid dates (reported by @hostep) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#9743: Invalid date when customer validate with French locale (reported by @vjacquemin-sqli) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#9981: M2 suggests running setup:upgrade if version number of module is higher than expected (reported by @chickenland) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#10834: signing in after selecting checkout button, will not end up to checkout page! (reported by @MMaKenZi) has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 299109f 2. 57318bf 3. 41cd961 4. 076b903 5. 435a6c2 6. 5d174b8 7. a47b10d 8. ab48cb1 9. 46be4c7 10. eafc6f0 11. 63b9e90 12. 2edfe9a 13. ef5ddff 14. 4ada797 15. c5d9a01 16. 72e9e07 17. 215180d 18. 685d506 - magento/magento2#5846: Product import doesn't import all products, but still gives success message (reported by @jameswithers) has been fixed in magento-engcom/magento2ce#1343 by @vkublytskyi in 2.3-develop branch Related commits: 1. 268b0c9 2. 5fcde49 3. 18b716e 4. c20ed34 5. 2f38a65 6. 767305a 7. 97fac9f 8. 14a4df8 9. d57fcb0 10. 0f4ffba
2 parents f76f280 + 7f14ba6 commit 699d7a1

File tree

53 files changed

+1188
-359
lines changed

Some content is hidden

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

53 files changed

+1188
-359
lines changed

app/code/Magento/Analytics/Model/Connector/Http/JsonConverter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class JsonConverter implements ConverterInterface
2222
*/
2323
private $serializer;
2424

25+
/**
26+
* @param Json $serializer
27+
*/
2528
public function __construct(Json $serializer)
2629
{
2730
$this->serializer = $serializer;

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function execute()
122122
/**
123123
* Place order for checkout flow
124124
*
125-
* @return string
125+
* @return void
126126
*/
127127
protected function placeCheckoutOrder()
128128
{

app/code/Magento/Backend/Block/Cache.php

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,29 @@ protected function _construct()
2222
$this->_headerText = __('Cache Storage Management');
2323
parent::_construct();
2424
$this->buttonList->remove('add');
25-
$this->buttonList->add(
26-
'flush_magento',
27-
[
28-
'label' => __('Flush Magento Cache'),
29-
'onclick' => 'setLocation(\'' . $this->getFlushSystemUrl() . '\')',
30-
'class' => 'primary flush-cache-magento'
31-
]
32-
);
3325

34-
$message = __('The cache storage may contain additional data. Are you sure that you want to flush it?');
35-
$this->buttonList->add(
36-
'flush_system',
37-
[
38-
'label' => __('Flush Cache Storage'),
39-
'onclick' => 'confirmSetLocation(\'' . $message . '\', \'' . $this->getFlushStorageUrl() . '\')',
40-
'class' => 'flush-cache-storage'
41-
]
42-
);
26+
if ($this->_authorization->isAllowed('Magento_Backend::flush_magento_cache')) {
27+
$this->buttonList->add(
28+
'flush_magento',
29+
[
30+
'label' => __('Flush Magento Cache'),
31+
'onclick' => 'setLocation(\'' . $this->getFlushSystemUrl() . '\')',
32+
'class' => 'primary flush-cache-magento'
33+
]
34+
);
35+
}
36+
37+
if ($this->_authorization->isAllowed('Magento_Backend::flush_cache_storage')) {
38+
$message = __('The cache storage may contain additional data. Are you sure that you want to flush it?');
39+
$this->buttonList->add(
40+
'flush_system',
41+
[
42+
'label' => __('Flush Cache Storage'),
43+
'onclick' => 'confirmSetLocation(\'' . $message . '\', \'' . $this->getFlushStorageUrl() . '\')',
44+
'class' => 'flush-cache-storage'
45+
]
46+
);
47+
}
4348
}
4449

4550
/**
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\Block\Cache;
8+
9+
use Magento\Framework\AuthorizationInterface;
10+
use Magento\Framework\View\Element\Block\ArgumentInterface;
11+
12+
/**
13+
* Class Permissions
14+
*/
15+
class Permissions implements ArgumentInterface
16+
{
17+
/**
18+
* @var AuthorizationInterface
19+
*/
20+
private $authorization;
21+
22+
/**
23+
* Permissions constructor.
24+
*
25+
* @param AuthorizationInterface $authorization
26+
*/
27+
public function __construct(AuthorizationInterface $authorization)
28+
{
29+
$this->authorization = $authorization;
30+
}
31+
32+
/**
33+
* @return bool
34+
*/
35+
public function hasAccessToFlushCatalogImages()
36+
{
37+
return $this->authorization->isAllowed('Magento_Backend::flush_catalog_images');
38+
}
39+
/**
40+
* @return bool
41+
*/
42+
public function hasAccessToFlushJsCss()
43+
{
44+
return $this->authorization->isAllowed('Magento_Backend::flush_js_css');
45+
}
46+
/**
47+
* @return bool
48+
*/
49+
public function hasAccessToFlushStaticFiles()
50+
{
51+
return $this->authorization->isAllowed('Magento_Backend::flush_static_files');
52+
}
53+
/**
54+
* @return bool
55+
*/
56+
public function hasAccessToAdditionalActions()
57+
{
58+
return ($this->hasAccessToFlushCatalogImages()
59+
|| $this->hasAccessToFlushJsCss()
60+
|| $this->hasAccessToFlushStaticFiles());
61+
}
62+
}

app/code/Magento/Backend/Block/Widget/Grid/Massaction.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Backend\Block\Widget\Grid;
78

9+
use Magento\Backend\Block\Template\Context;
10+
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\AuthorizationInterface;
12+
use Magento\Framework\DataObject;
13+
use Magento\Framework\Json\EncoderInterface;
14+
815
/**
916
* Grid widget massaction default block
1017
*
@@ -14,4 +21,72 @@
1421
*/
1522
class Massaction extends \Magento\Backend\Block\Widget\Grid\Massaction\AbstractMassaction
1623
{
24+
/**
25+
* @var AuthorizationInterface
26+
*/
27+
private $authorization;
28+
29+
/**
30+
* Map bind item id to a particular acl type
31+
* itemId => acl
32+
*
33+
* @var array
34+
*/
35+
private $restrictions = [
36+
'enable' => 'Magento_Backend::toggling_cache_type',
37+
'disable' => 'Magento_Backend::toggling_cache_type',
38+
'refresh' => 'Magento_Backend::refresh_cache_type',
39+
];
40+
41+
/**
42+
* Massaction constructor.
43+
*
44+
* @param Context $context
45+
* @param EncoderInterface $jsonEncoder
46+
* @param array $data
47+
* @param AuthorizationInterface $authorization
48+
*/
49+
public function __construct(
50+
Context $context,
51+
EncoderInterface $jsonEncoder,
52+
array $data = [],
53+
AuthorizationInterface $authorization = null
54+
) {
55+
$this->authorization = $authorization ?: ObjectManager::getInstance()->get(AuthorizationInterface::class);
56+
57+
parent::__construct($context, $jsonEncoder, $data);
58+
}
59+
60+
/**
61+
* {@inheritdoc}
62+
*
63+
* @param string $itemId
64+
* @param array|DataObject $item
65+
*
66+
* @return $this
67+
*/
68+
public function addItem($itemId, $item)
69+
{
70+
if (!$this->isRestricted($itemId)) {
71+
parent::addItem($itemId, $item);
72+
}
73+
74+
return $this;
75+
}
76+
77+
/**
78+
* Check if access to action restricted
79+
*
80+
* @param string $itemId
81+
*
82+
* @return bool
83+
*/
84+
private function isRestricted(string $itemId): bool
85+
{
86+
if (!key_exists($itemId, $this->restrictions)) {
87+
return false;
88+
}
89+
90+
return !$this->authorization->isAllowed($this->restrictions[$itemId]);
91+
}
1792
}

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php

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

1212
class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache
1313
{
14+
/**
15+
* Authorization level of a basic admin session
16+
*
17+
* @see _isAllowed()
18+
*/
19+
const ADMIN_RESOURCE = 'Magento_Backend::flush_catalog_images';
20+
1421
/**
1522
* Clean JS/css files cache
1623
*

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php

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

1212
class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache
1313
{
14+
/**
15+
* Authorization level of a basic admin session
16+
*
17+
* @see _isAllowed()
18+
*/
19+
const ADMIN_RESOURCE = 'Magento_Backend::flush_js_css';
20+
1421
/**
1522
* Clean JS/css files cache
1623
*

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php

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

1111
class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache
1212
{
13+
/**
14+
* Authorization level of a basic admin session
15+
*
16+
* @see _isAllowed()
17+
*/
18+
const ADMIN_RESOURCE = 'Magento_Backend::flush_static_files';
19+
1320
/**
1421
* Clean static files cache
1522
*

app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php

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

99
class FlushAll extends \Magento\Backend\Controller\Adminhtml\Cache
1010
{
11+
/**
12+
* Authorization level of a basic admin session
13+
*
14+
* @see _isAllowed()
15+
*/
16+
const ADMIN_RESOURCE = 'Magento_Backend::flush_cache_storage';
17+
1118
/**
1219
* Flush cache storage
1320
*

app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php

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

99
class FlushSystem extends \Magento\Backend\Controller\Adminhtml\Cache
1010
{
11+
/**
12+
* Authorization level of a basic admin session
13+
*
14+
* @see _isAllowed()
15+
*/
16+
const ADMIN_RESOURCE = 'Magento_Backend::flush_magento_cache';
17+
1118
/**
1219
* Flush all magento cache
1320
*

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
*/
1717
class MassDisable extends \Magento\Backend\Controller\Adminhtml\Cache
1818
{
19+
/**
20+
* Authorization level of a basic admin session
21+
*
22+
* @see _isAllowed()
23+
*/
24+
const ADMIN_RESOURCE = 'Magento_Backend::toggling_cache_type';
25+
1926
/**
2027
* @var State
2128
*/

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
*/
1717
class MassEnable extends \Magento\Backend\Controller\Adminhtml\Cache
1818
{
19+
/**
20+
* Authorization level of a basic admin session
21+
*
22+
* @see _isAllowed()
23+
*/
24+
const ADMIN_RESOURCE = 'Magento_Backend::toggling_cache_type';
25+
1926
/**
2027
* @var State
2128
*/

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php

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

1212
class MassRefresh extends \Magento\Backend\Controller\Adminhtml\Cache
1313
{
14+
/**
15+
* Authorization level of a basic admin session
16+
*
17+
* @see _isAllowed()
18+
*/
19+
const ADMIN_RESOURCE = 'Magento_Backend::refresh_cache_type';
20+
1421
/**
1522
* Mass action for cache refresh
1623
*

0 commit comments

Comments
 (0)