tags:

views:

49

answers:

1

Hi,

We created new action similar to 'hold', 'ship' and others in the 'sales_order/view' admin section that can be triggered by clicking at the button. Afterward, we added our new action to the ACL with the following code in config.xml:

 <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 functionality works, however, in the 'Role Resources Tree'(System/Permissions/Roles/Role Resources) our new action does never show up as selected(checked) even thou it is allowed for particular Role. I can see that from table 'admin_rule' with resource id for our new action that it is allowed, so it needs to show up selected, but it is not.

When trying to solve this issue i looked into the template(permissions/rolesedit.phtml) and I found that the 'role resource tree' is drawn with help of Javascript...thats where i got stuck due to my limited knowledge in Javascript.

Why the role resource tree does not display our new ACL entry correctly, that is the check box is never checked?

Thank You for helping
margots

A: 

I found the issue.

Apparently all letters for acl tag has to be lower case in order to draw 'resource tree' correctly. Once I changed the 'shipNew' to 'shipnew' the 'resource tree' is being draw correctly in admin->system->permissions->roles->role resource

Correct code would look as following:

   <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>  

I also removed 'title', 'order' tag that seem to be unnecessary

I hope this is useful

latvian