Implemented security to authenticate users with their roles.