I came across this post when I was looking for a way to select all admin users belonging to a specific user role. (See this answer and this question .) The question here can be read as if Alex wants admin users for each role. Since the answer is not sorted by administrator role, I would like to suggest the following solution:
$usersByRole = array(); $adminRoles = Mage::getModel('admin/roles')->getCollection(); foreach($adminRoles as $adminRole) { $adminRoleId = $adminRole->getId(); $adminRoleUserCollection = Mage::getModel('admin/role')->getCollection() ->addFieldToFilter('parent_id', ['eq'=>$adminRoleId]) ->join(['user' => 'admin/user'], 'user.user_id=main_table.user_id'); $usersByRole[$adminRole->getRoleName()] = $adminRoleUserCollection; }
source share