function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hemmhemm 

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?

Ryan-GuestRyan-Guest

UserType is more reliable.