Get the user role on Login

Yes, I had tried similar way but it was giving me an error. I will add it again and let you know the result.

Also, what do you mean by

Do I have to add it in namespace somewhere as I was getting that error only saying it is not in the namespace