You define roles in the deployment descriptor file web.xml and the corresponding role mappings in the sun-web.xml deployment descriptor file for individually deployed web modules.