CLOUD-158 Refactored credential related code to support user roles