How to allow only few modules to the the newly created user

i want to create an employee when creating an employee, i am using the create user button under “User Details” section then a user is being created

but when the user is created i want to give a role profile and module profile to the user automatically because the user is an employee and as of now, by default all modules are checked for the user when created using the create user button under “User Details” section when creating an employee
how can i do it?
can i use doctype events for the user doctype, if so how can i identify if the user being created is an employee, beacuse user is being created using the create user button under “User Details” section ?