0
votes

i have a user role that can see only a few pages of the magento backend. when i log in as that user, i want to redirect it to another backend module controller instead of the dashboard.

This is only for his user role.

someone an idea?

2

2 Answers

0
votes

There's now built-in method for what you are trying to accomplish but here are some insights for you to turn them into a solution:

  1. There's a setting in System -> Configuration -> ADVANCED -> Admin called "Startup Page" that would let you change this setting globally (but not indivudually by admin or by role).
  2. In Mage_Admin_Model_User::getStartupPageUrl() you'll see that if whatever is set up in the previous setting is not allowed by the resource, it will navigate through the menues in order and find the first allowed page

So I'm thinking yuo can tinker around with the menu configuration changing the order of the items so that the first resource allowed by your custom role is something different than whatever is setup as default.

Another simple solution would be to observe some event (like admin_user_authenticate_after ) and redirect the user to the desired page if it's from a given role

0
votes

You can controll your access permission with this code in your config.xml from modules.

<acl>
        <resources>
            <admin>
                <children>
                    <catalog>
                        <children>
                            <yourmodule translate="title" module="yourmodule">
                                <title>any</title>
                                <sort_order>700</sort_order>
                            </yourmodule>
                        </children>
                    </catalog>
                </children>
            </admin>
        </resources>
    </acl>

With this you can with your admin role user on System menu user control you can enable or disable the acess to choose group of users. If you need control what page show for each user, do it on your controller at same module. If you need more info ask and i complete here.