code to attached roles to user menu

Hi,

I need a code that can enable me attached roles to menu such that each time i assign a user menu the user is automatically assign the roles along.

Gbenga