From 11e1648e3e51daee20d0c22f93f086c9a6f36cbf Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 1 Nov 2024 00:25:26 +0100 Subject: [PATCH 1/3] allow acl settings for config groups --- .../Adminhtml/Block/System/Config/Form.php | 7 ++++++- app/code/core/Mage/Sitemap/etc/adminhtml.xml | 18 ++++++++++++++++++ app/code/core/Mage/Sitemap/etc/system.xml | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index 407e35d8226..60deb369565 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -592,7 +592,12 @@ public function canUseWebsiteValue($field) protected function _canShowField($field) { $ifModuleEnabled = trim((string)$field->if_module_enabled); - if ($ifModuleEnabled && !Mage::helper('Core')->isModuleEnabled($ifModuleEnabled)) { + if ($ifModuleEnabled && !Mage::helper('core')->isModuleEnabled($ifModuleEnabled)) { + return false; + } + + $aclResource = trim((string)$field->acl_rescource); + if ($aclResource && !Mage::getSingleton('admin/session')->isAllowed($aclResource)) { return false; } diff --git a/app/code/core/Mage/Sitemap/etc/adminhtml.xml b/app/code/core/Mage/Sitemap/etc/adminhtml.xml index fdd941080f4..1e16b7886dc 100644 --- a/app/code/core/Mage/Sitemap/etc/adminhtml.xml +++ b/app/code/core/Mage/Sitemap/etc/adminhtml.xml @@ -43,6 +43,24 @@ Google Sitemap + + + Categories Options + 10 + + + Products Options + 20 + + + CMS Pages Options + 30 + + + Generation Settings + 40 + + diff --git a/app/code/core/Mage/Sitemap/etc/system.xml b/app/code/core/Mage/Sitemap/etc/system.xml index 216e6c29a98..b99389a9db9 100644 --- a/app/code/core/Mage/Sitemap/etc/system.xml +++ b/app/code/core/Mage/Sitemap/etc/system.xml @@ -30,6 +30,7 @@ 1 1 1 + system/config/sitemap/category @@ -69,6 +70,7 @@ 1 1 1 + system/config/sitemap/product @@ -108,6 +110,7 @@ 1 1 1 + system/config/sitemap/page @@ -147,6 +150,7 @@ 1 0 0 + system/config/generate/page From 70312f39a748dfd390c78574ae79d43cdc32482e Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 6 Nov 2024 07:52:09 +0100 Subject: [PATCH 2/3] reverted DEMO change ti sitemap module --- app/code/core/Mage/Sitemap/etc/adminhtml.xml | 18 ------------------ app/code/core/Mage/Sitemap/etc/system.xml | 4 ---- 2 files changed, 22 deletions(-) diff --git a/app/code/core/Mage/Sitemap/etc/adminhtml.xml b/app/code/core/Mage/Sitemap/etc/adminhtml.xml index 1e16b7886dc..fdd941080f4 100644 --- a/app/code/core/Mage/Sitemap/etc/adminhtml.xml +++ b/app/code/core/Mage/Sitemap/etc/adminhtml.xml @@ -43,24 +43,6 @@ Google Sitemap - - - Categories Options - 10 - - - Products Options - 20 - - - CMS Pages Options - 30 - - - Generation Settings - 40 - - diff --git a/app/code/core/Mage/Sitemap/etc/system.xml b/app/code/core/Mage/Sitemap/etc/system.xml index b99389a9db9..216e6c29a98 100644 --- a/app/code/core/Mage/Sitemap/etc/system.xml +++ b/app/code/core/Mage/Sitemap/etc/system.xml @@ -30,7 +30,6 @@ 1 1 1 - system/config/sitemap/category @@ -70,7 +69,6 @@ 1 1 1 - system/config/sitemap/product @@ -110,7 +108,6 @@ 1 1 1 - system/config/sitemap/page @@ -150,7 +147,6 @@ 1 0 0 - system/config/generate/page From b58587d6b82fdf9df446f120c84f4a23622c9ad1 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Wed, 25 Dec 2024 15:54:36 +0100 Subject: [PATCH 3/3] cs --- app/code/core/Mage/Adminhtml/Block/System/Config/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index 0f561d24e38..bfa207a3d61 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -596,7 +596,7 @@ protected function _canShowField($field) return false; } - $aclResource = trim((string)$field->acl_rescource); + $aclResource = trim((string) $field->acl_rescource); if ($aclResource && !Mage::getSingleton('admin/session')->isAllowed($aclResource)) { return false; }