Skip to main content
edited body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

I have a module that adds a new menu in the backend. I have the acls defined and they work:

<acl>
 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <sub_a translate="title">
                            <title>sub 1</title>
                        </sub_a>
                        <sub_b>
                            <title>sub_b</title>
                        </sub_b>
                       ....
                    </children>
                </module>
            </children>
        </admin>
    </resources>
</acl>

This works. I also add custom menu options using PHP, depending on conditions (at the location of the dots). If I add acls for them too, this also works.

But I don't need all this acls! Is there a way to allow all the children of module? The XML should look something like this:

<acl>
 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                </module>
            </children>
        </admin>
    </resources>
</acl>

But all the children should be allowed!

So instead of many checkboxes for the permission configuration, I want a single checkbox.

If I use the second xml, only the topmost menu option is visible in the backend and the whole submenu is hidden.

How can I keep the submenu visible without creating a acl rule for every menu option?

I have a module that adds a new menu in the backend. I have the acls defined and they work:

<acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <sub_a translate="title">
                            <title>sub 1</title>
                        </sub_a>
                        <sub_b>
                            <title>sub_b</title>
                        </sub_b>
                       ....
                    </children>
                </module>
            </children>
        </admin>
    </resources>
</acl>

This works. I also add custom menu options using PHP, depending on conditions (at the location of the dots). If I add acls for them too, this also works.

But I don't need all this acls! Is there a way to allow all the children of module? The XML should look something like this:

<acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                </module>
            </children>
        </admin>
    </resources>
</acl>

But all the children should be allowed!

So instead of many checkboxes for the permission configuration, I want a single checkbox.

If I use the second xml, only the topmost menu option is visible in the backend and the whole submenu is hidden.

How can I keep the submenu visible without creating a acl rule for every menu option?

I have a module that adds a new menu in the backend. I have the acls defined and they work:

 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <sub_a translate="title">
                            <title>sub 1</title>
                        </sub_a>
                        <sub_b>
                            <title>sub_b</title>
                        </sub_b>
                       ....
                    </children>
                </module>
            </children>
        </admin>
    </resources>
</acl>

This works. I also add custom menu options using PHP, depending on conditions (at the location of the dots). If I add acls for them too, this also works.

But I don't need all this acls! Is there a way to allow all the children of module? The XML should look something like this:

 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                </module>
            </children>
        </admin>
    </resources>
</acl>

But all the children should be allowed!

So instead of many checkboxes for the permission configuration, I want a single checkbox.

If I use the second xml, only the topmost menu option is visible in the backend and the whole submenu is hidden.

How can I keep the submenu visible without creating a acl rule for every menu option?

Tweeted twitter.com/#!/StackMagento/status/642079010831364096
Source Link
Josef
  • 511
  • 2
  • 9
  • 20

Magento ACL recursive permissions?

I have a module that adds a new menu in the backend. I have the acls defined and they work:

<acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <sub_a translate="title">
                            <title>sub 1</title>
                        </sub_a>
                        <sub_b>
                            <title>sub_b</title>
                        </sub_b>
                       ....
                    </children>
                </module>
            </children>
        </admin>
    </resources>
</acl>

This works. I also add custom menu options using PHP, depending on conditions (at the location of the dots). If I add acls for them too, this also works.

But I don't need all this acls! Is there a way to allow all the children of module? The XML should look something like this:

<acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                </module>
            </children>
        </admin>
    </resources>
</acl>

But all the children should be allowed!

So instead of many checkboxes for the permission configuration, I want a single checkbox.

If I use the second xml, only the topmost menu option is visible in the backend and the whole submenu is hidden.

How can I keep the submenu visible without creating a acl rule for every menu option?