gpt4 book ai didi

magento - 如何将 Magento 管理菜单链接到角色资源

转载 作者:行者123 更新时间:2023-12-02 13:17:49 25 4
gpt4 key购买 nike

情况如下:

我想在 Magento 后端导航菜单中添加一个菜单。
我通过在 app/etc/config.xml 中添加以下代码来完成此操作:

<adminhtml>
<menu>
<example translate="title" module="adminhtml">
<title>Inventory</title>
<sort_order>110</sort_order>
<children>
<set_time>
<title>Set It!</title>
<action>helloworld/index/goodbye</action>
</set_time>
</children>
</example>
</menu>

问题是我无法将此菜单包含在权限->角色资源中,因此我无法将其分配给特定用户。

如何将此菜单包含在权限->角色资源中?

谢谢你,还有更多的力量!

最佳答案

您需要告诉magento您希望新的菜单位置在权限树中可见。为此,您必须将 ACL 部分添加到配置数据中。将其放入模块的 config.xml 文件中:

     <acl>
<resources>
<admin>
<children>
<example>
<title>Inventory</title>
<sort_order>110</sort_order>
<children>
<set_time>
<title>Set It!</title>
<sort_order>0</sort_order>
</set_time>
</children>
</example>
</children>
</admin>
</resources>
</acl>

关于magento - 如何将 Magento 管理菜单链接到角色资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3447644/

25 4 0