Can We Create A Menu For An Admin User Group?

Hi,

Can we create a menu, and make only available for a specific Admin User Group?

Thanks

You could do it by creating an addon that presented the menu and then control it with permissions.

Hello!

You can find examples of creating permissions in the default add-ons like Reward points and Gift certificates.

I have looked at the Reward points addon code as an example of how to turn menu items off and on but I still can't seem to figure it out. I am trying to turn the Products menu off for admin users that are in a certain admin user group. I made a file called admin.post.php and put it in app/addons/my_changes/schema/permissions/. I want to NOT show the whole Products menu if the admin user is a member of the user group with ID 22. First I tried using the priviliges checkboxes - but when I turn off View Catalog permissions from in there, the Products menu doesn't show (which IS what I want), but then the admin user also can't see or add any products when adding an order via admin. I need this user group to be able to add orders (and add products to the orders), but not to see the Products menu. So I need to add code manually to turn off the Products menu for admin users in this group. What is the code I would use in my admin.post.php to remove the Products menu if the admin user group is 22?

I have tried this:

if(in_array(22,$schema['conditions']['usergroup'])) {
$schema['controllers']['products']['modes']['view']['permissions'] = false;
}
return $schema;
?>

But when I upload this code, instead of removing the Products menu for that user group, it show the WHOLE admin menu for that user group, even menu items that should be restricted by the user group priviliges.

Try to remove the controllers element. E.g.


            

No, that didn't work either. I actually even tried commenting out the whole if statement part and just leaving the line setting the schema element to false (so I would think it would turn off the Products menu for ALL admin users, right?), and it still didn't work. I logged in as a territory manager admin user and a super admin user and the Products menu shows for both.

So either this code is being overridden by something else? Or it's not the correct schema element? Or I have the admin.post.php file in the wrong place?

Try to temporary add the following code to the file and clear cache

fn_print_r($schema);

Then refresh page and check if you see debug information