getRole function implemented