Role checking

Implemented role checking for determining which module will be loaded.