The SalesLogix SLXUserService class in the Sage.SalesLogix.Security assembly allows you to get a reference to the current user’s IUser interface. With a reference to the current IUser interface you can then check the user’s Type property to see what type of User license the user has.
The User’s Type is based on the UserType enumeration found in the Sage.Entities.Interfaces assembly.
The choices for this are:
-
AddOn
-
Admin
-
Concurrent
-
Network
-
Remote
-
Retired
-
Template
-
Web
- WebViewer
Here is a sample code snippet to check if the current user is a web viewer:
Sage.SalesLogix.Security.SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();
Sage.Entity.Interfaces.IUser user = usersvc.GetUser();
if (user.Type == Sage.Entity.Interfaces.UserType.WebViewer)
{
//Do something because they are a web viewer
}



