What is the right way to get the current users profile in an apex class?
When I tried to print the following in visualforce page, i am able to get the profile name
<apex:outputText value="{!$Profile.Name}"/>
But when i tried to print in the Apex class using System.debug(Profile.Name)
, I couldn't.