Skip to content

Commit 11e1648

Browse files
committed
allow acl settings for config groups
1 parent 7427284 commit 11e1648

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

app/code/core/Mage/Adminhtml/Block/System/Config/Form.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,12 @@ public function canUseWebsiteValue($field)
592592
protected function _canShowField($field)
593593
{
594594
$ifModuleEnabled = trim((string)$field->if_module_enabled);
595-
if ($ifModuleEnabled && !Mage::helper('Core')->isModuleEnabled($ifModuleEnabled)) {
595+
if ($ifModuleEnabled && !Mage::helper('core')->isModuleEnabled($ifModuleEnabled)) {
596+
return false;
597+
}
598+
599+
$aclResource = trim((string)$field->acl_rescource);
600+
if ($aclResource && !Mage::getSingleton('admin/session')->isAllowed($aclResource)) {
596601
return false;
597602
}
598603

app/code/core/Mage/Sitemap/etc/adminhtml.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@
4343
<children>
4444
<sitemap translate="title" module="shipping">
4545
<title>Google Sitemap</title>
46+
<children>
47+
<category translate="title">
48+
<title>Categories Options</title>
49+
<sort_order>10</sort_order>
50+
</category>
51+
<product translate="title">
52+
<title>Products Options</title>
53+
<sort_order>20</sort_order>
54+
</product>
55+
<page translate="title">
56+
<title>CMS Pages Options</title>
57+
<sort_order>30</sort_order>
58+
</page>
59+
<generate translate="title">
60+
<title>Generation Settings</title>
61+
<sort_order>40</sort_order>
62+
</generate>
63+
</children>
4664
</sitemap>
4765
</children>
4866
</config>

app/code/core/Mage/Sitemap/etc/system.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<show_in_default>1</show_in_default>
3131
<show_in_website>1</show_in_website>
3232
<show_in_store>1</show_in_store>
33+
<acl_resource>system/config/sitemap/category</acl_resource>
3334
<fields>
3435
<changefreq translate="label">
3536
<label>Frequency</label>
@@ -69,6 +70,7 @@
6970
<show_in_default>1</show_in_default>
7071
<show_in_website>1</show_in_website>
7172
<show_in_store>1</show_in_store>
73+
<acl_resource>system/config/sitemap/product</acl_resource>
7274
<fields>
7375
<changefreq translate="label">
7476
<label>Frequency</label>
@@ -108,6 +110,7 @@
108110
<show_in_default>1</show_in_default>
109111
<show_in_website>1</show_in_website>
110112
<show_in_store>1</show_in_store>
113+
<acl_resource>system/config/sitemap/page</acl_resource>
111114
<fields>
112115
<changefreq translate="label">
113116
<label>Frequency</label>
@@ -147,6 +150,7 @@
147150
<show_in_default>1</show_in_default>
148151
<show_in_website>0</show_in_website>
149152
<show_in_store>0</show_in_store>
153+
<acl_resource>system/config/generate/page</acl_resource>
150154
<fields>
151155
<enabled translate="label">
152156
<label>Enabled</label>

0 commit comments

Comments
 (0)