我们在“sales_order / view”管理部分创建了类似于“hold”,“ship”和其他类似的新操作,可以通过单击按钮触发。之后,我们使用config.xml中的以下代码将新操作添加到ACL:
<acl>
<resources>
<admin>
<children>
<sales>
<children>
<order>
<children>
<actions translate="title">
<title>Actions</title>
<children>
<shipNew translate="title"><title>Ship Ups</title></shipNew>
</children>
</actions>
</children>
<sort_order>10</sort_order>
</order>
</children>
</sales>
</children>
</admin>
</resources>
</acl>
然而,ACL功能在“角色资源树”(系统/权限/角色/角色资源)中起作用,即使您允许特定角色,我们的新操作也不会显示为已选中(已选中)。我可以从表'admin_rule'看到我们允许的新操作的资源ID,所以它需要显示选中,但事实并非如此。
当我试图解决这个问题时,我查看了模板(permissions / rolesedit.phtml),我发现'角色资源树'是在Javascript的帮助下绘制的......那是因为我的知识有限而陷入困境的地方在Javascript中。
为什么角色资源树没有正确显示我们的新ACL条目,即从不检查复选框?
感谢您的帮助 margots
答案 0 :(得分:0)
我发现了这个问题。
显然,为了正确绘制“资源树”,acl标签的所有字母都必须是小写的。一旦我将'shipNew'更改为'shipnew',就会在admin-&gt; system-&gt; permissions-&gt; roles-&gt; role resource
中正确绘制'资源树'。正确的代码如下所示:
<acl>
<resources>
<admin>
<children>
<sales>
<order>
<children>
<actions>
<children>
<shipnew translate="title"><title>Ship Ups</title></shipnew>
</children>
</actions>
</children>
</order>
</children>
</sales>
</children>
</admin>
</resources>
</acl>
我还删除了似乎没必要的'title','order'标签
我希望这很有用