How do i enable only certain modules to a user programmatically

Hi Guys,

I have a custom doctype which will create a user and assign the roles programmatically. I would like to extend this customisation by enabling certain module to that particular user. I see that by default all the modules will be enabled and manually going and disabling the modules from user list doesnt make sense to me.

So, I am looking if there is a method or a way to enable only required modules for user after the user is created and roles are assigned programmatically.

Thanks in advance,

Regards,
Praveen N

Hi @praveensn23 I have same requirement, May i get to know how you have achieved it?

@praveensn23 create a module profile, select the specific modules for that profile, and set the module profile name when creating the user, this works for me…