+ Start a Discussion

User.UserType vs. User.profile.userlicense.name

I am looking to add some logic into an AppExchange app that cares about the type of user logged in.  I see 2 places where I can get similar information, but it's a bit different.  I am wondering what the recommendation is as to how these values should be used and/or which is more reliable.


1) User.UserType - this is accessible via UserInfo.getUserType();


2) License Name - this is accessible when querying User and selecting the profile.userlicense.name field.


My main desire is to know whether a Guest user is accessing the functionality (Salesforce Sites). Are these 2 values equally reliable?


UserType is more reliable.