Filter Create and Create from vCard from Left Menu - in bulk, based on user

Okay so I know that if I override a menu.php file in one specific module, I can remove the Create and Create from vCard options, but I figured I would ask my question - before I go down a bit of a rabbit hole.

Situation is this - I would say over half of the modules for 90% of the users we need to remove the create option, but still allow them to edit. It seems that the roles are create/edit combined so it doesn’t appear role management will cover this. I have tested on the one menu option for removing it and it seems pretty straight forward in the php. However, is there a base menu file that I’m just not seeing? I figure I can create a method and if the user is in this list of roles, or the module is in this list of module names, then override the menu and remove the create/create from vcard.

I would love to not have to build this out for each module, but that is the current path I see.

Welcome to the community @jkortus1234 :wave:

Having a wee look you can extend the Menus ‘globally’ by using the Extension Framework.

add a new file to custom/Extensions/application/Ext/Menus/whatever_you_want.php.
This file would act as the filter. Menus are generated here: https://github.com/salesagility/SuiteCRM/blob/master/include/MVC/View/SugarView.php#L1365

But the good thing is, at the very bottom of that function it calls the extension framework last which can act as the ‘global’ interceptor :wink: https://github.com/salesagility/SuiteCRM/blob/master/include/MVC/View/SugarView.php#L1420

You will need to loop through the $module_menu retrospectively but at least you can unset array items this way all in one place. :+1:

An alternative - and code free- would be to use some CSS changes to style.scss (which creates style.css) to hide the create buttons.

I use it to make the EDIT buttons wider (easier to click) and the SAVE button wider and green (points the user at their next step).

But malicious users could get round that by hand-crafting POST statements… if that was a concern you had… then you would need to code it behind the scenes.

Similar to using style.css : would be to do the CSS changes but in JS.