forked from OpenMage/magento-lts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix admin ACL mismatch for OAuth (OpenMage#3272) (OpenMage#3274)
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
- Loading branch information
1 parent
58be830
commit 68cb9ec
Showing
7 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/code/core/Mage/Oauth/data/oauth_setup/upgrade-1.0.0.0-1.0.0.1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* OpenMage | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available at https://opensource.org/license/osl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Admin | ||
* @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** @var Mage_Core_Model_Resource_Setup $installer */ | ||
$installer = $this; | ||
$installer->startSetup(); | ||
|
||
$table = $installer->getTable('admin/rule'); | ||
$resourceIds = [ | ||
'admin/system/api/consumer' => 'admin/system/api/oauth_consumer', | ||
'admin/system/api/consumer/delete' => 'admin/system/api/oauth_consumer/delete', | ||
'admin/system/api/consumer/edit' => 'admin/system/api/oauth_consumer/edit', | ||
'admin/system/api/authorizedTokens' => 'admin/system/api/oauth_authorized_tokens' | ||
]; | ||
|
||
foreach ($resourceIds as $oldId => $newId) { | ||
$installer->getConnection()->update( | ||
$table, | ||
['resource_id' => $newId], | ||
['resource_id = ?' => $oldId] | ||
); | ||
} | ||
|
||
$installer->endSetup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters