Skip to content

Commit 187dcb9

Browse files
authored
Merge branch '2.4-develop' into fix-for-issue-12075
2 parents 955823a + bb1c882 commit 187dcb9

File tree

968 files changed

+30063
-12060
lines changed

Some content is hidden

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

968 files changed

+30063
-12060
lines changed

.github/ISSUE_TEMPLATE/developer-experience-issue.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Developer experience issue
2+
description: Issues related to customization, extensibility, modularity
3+
labels: ['Triage: Dev.Experience']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please read [our guidelines](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report-an-issue) before submitting the issue.
9+
- type: textarea
10+
attributes:
11+
label: Summary
12+
description: |
13+
Describe the issue you are experiencing.
14+
Include general information, error messages, environments, and so on.
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Examples
20+
description: |
21+
Provide code examples or a patch with a test (recommended) to clearly indicate the problem.
22+
validations:
23+
required: true
24+
- type: textarea
25+
attributes:
26+
label: Proposed solution
27+
description: |
28+
Suggest your potential solutions for this issue.
29+
- type: textarea
30+
attributes:
31+
label: Release note
32+
description: |
33+
Help us to provide meaningful release notes to the community.
34+
- type: checkboxes
35+
attributes:
36+
label: Triage and priority
37+
description: |
38+
Provide [Severity](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#community-backlog-priority) assessment for the Issue as a Reporter.
39+
This information helps us during the Confirmation and Issue triage processes.
40+
options:
41+
- label: 'Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._'
42+
- label: 'Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._'
43+
- label: 'Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._'
44+
- label: 'Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._'
45+
- label: 'Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._'

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Feature request
2+
description: Report to https://github.com/magento/community-features
3+
labels: ['feature request']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Important: This repository is intended only for Magento 2 Technical Issues.
9+
Enter Feature Requests at https://github.com/magento/community-features.
10+
Project stakeholders monitor and manage requests.
11+
Feature requests entered using this form may be moved to the forum.
12+
- type: textarea
13+
attributes:
14+
label: Description
15+
description: |
16+
Describe the feature you would like to add.
17+
validations:
18+
required: true
19+
- type: textarea
20+
attributes:
21+
label: Expected behavior
22+
description: |
23+
What is the expected behavior of this feature?
24+
How is it going to work?
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: Benefits
30+
description: |
31+
How do you think this feature would improve Magento?
32+
- type: textarea
33+
attributes:
34+
label: Additional information
35+
description: |
36+
What other information can you provide about the desired feature?
37+
- type: textarea
38+
attributes:
39+
label: Release note
40+
description: |
41+
Help us to provide meaningful release notes to the community.

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</div>
2828
HTML;
2929
}
30+
http_response_code(503);
3031
exit(1);
3132
}
3233

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\AdminAdobeIms\Api;
9+
10+
use Magento\Framework\Exception\CouldNotSaveException;
11+
12+
/**
13+
* Interface SaveImsUserInterface
14+
* Save Ims User & Role
15+
*/
16+
interface SaveImsUserInterface
17+
{
18+
/**
19+
* Add Admin Adobe IMS User with Default Role i.e "Adobe Ims" & No Permissions
20+
*
21+
* @param array $profile
22+
* @return void
23+
* @throws CouldNotSaveException
24+
*/
25+
public function save(array $profile): void;
26+
}

app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsEnableCommand.php

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
use Magento\AdminAdobeIms\Service\ImsConfig;
1212
use Magento\AdminAdobeIms\Service\UpdateTokensService;
1313
use Magento\AdobeImsApi\Api\AuthorizationInterface;
14+
use Magento\Authorization\Model\Acl\Role\Group;
15+
use Magento\Authorization\Model\ResourceModel\Role\CollectionFactory;
16+
use Magento\Authorization\Model\Role;
17+
use Magento\Authorization\Model\UserContextInterface;
1418
use Magento\Framework\App\Cache\Type\Config;
1519
use Magento\Framework\App\Cache\TypeListInterface;
20+
use Magento\Framework\App\ObjectManager;
1621
use Magento\Framework\Console\Cli;
1722
use Magento\Framework\Exception\InvalidArgumentException;
1823
use Magento\Framework\Exception\LocalizedException;
@@ -67,6 +72,16 @@ class AdminAdobeImsEnableCommand extends Command
6772
*/
6873
private UpdateTokensService $updateTokensService;
6974

75+
/**
76+
* @var Role
77+
*/
78+
private Role $role;
79+
80+
/**
81+
* @var CollectionFactory
82+
*/
83+
private CollectionFactory $roleCollection;
84+
7085
/**
7186
* @var AuthorizationInterface
7287
*/
@@ -78,20 +93,26 @@ class AdminAdobeImsEnableCommand extends Command
7893
* @param TypeListInterface $cacheTypeList
7994
* @param UpdateTokensService $updateTokensService
8095
* @param AuthorizationInterface $authorization
96+
* @param Role|null $role
97+
* @param CollectionFactory|null $roleCollection
8198
*/
8299
public function __construct(
83100
ImsConfig $adminImsConfig,
84101
ImsCommandOptionService $imsCommandOptionService,
85102
TypeListInterface $cacheTypeList,
86103
UpdateTokensService $updateTokensService,
87-
AuthorizationInterface $authorization
104+
AuthorizationInterface $authorization,
105+
Role $role = null,
106+
CollectionFactory $roleCollection = null
88107
) {
89108
parent::__construct();
90109
$this->adminImsConfig = $adminImsConfig;
91110
$this->imsCommandOptionService = $imsCommandOptionService;
92111
$this->cacheTypeList = $cacheTypeList;
93112
$this->updateTokensService = $updateTokensService;
94113
$this->authorization = $authorization;
114+
$this->role = $role ?: ObjectManager::getInstance()->get(Role::class);
115+
$this->roleCollection = $roleCollection ?: ObjectManager::getInstance()->get(CollectionFactory::class);
95116

96117
$this->setName('admin:adobe-ims:enable')
97118
->setDescription('Enable Adobe IMS Module.')
@@ -163,6 +184,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int
163184
if ($clientId && $clientSecret && $organizationId && $isTwoFactorAuthEnabled) {
164185
$enabled = $this->enableModule($clientId, $clientSecret, $organizationId, $isTwoFactorAuthEnabled);
165186
if ($enabled) {
187+
$this->saveImsAuthorizationRole();
166188
$output->writeln(__('Admin Adobe IMS integration is enabled'));
167189
return Cli::RETURN_SUCCESS;
168190
}
@@ -181,6 +203,27 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int
181203
}
182204
}
183205

206+
/**
207+
* Save new Adobe IMS role
208+
*
209+
* @return bool
210+
* @throws \Exception
211+
*/
212+
private function saveImsAuthorizationRole(): bool
213+
{
214+
$roleCollection = $this->roleCollection->create()->addFieldToFilter('role_name', 'Adobe Ims');
215+
if (!$roleCollection->getSize()) {
216+
$this->role->setRoleName('Adobe Ims')
217+
->setUserType((string)UserContextInterface::USER_TYPE_ADMIN)
218+
->setUserId(0)
219+
->setRoleType(Group::ROLE_TYPE)
220+
->setParentId(0)
221+
->save();
222+
}
223+
224+
return true;
225+
}
226+
184227
/**
185228
* Enable Admin Adobe IMS Module when testConnection was successfully
186229
*

0 commit comments

Comments
 (0)