There are likely times in Creatio when you need your code to behave differently depending on whether the current user is a full Creatio user or a portal user. This is a pretty easy thing to check. You can check if the current user is a portal user by using the following:
if (Terrasoft.isCurrentUserSsp()) {
// is a portal user
}
You can also use the following:
if (Terrasoft.CurrentUser.userType === Terrasoft.UserType.SSP) {
// is a portal user
}
Either way will get you what you need and your code can function accordingly. Once you know whether the current user is a portal user or not, you can still use the same methods to get the current user. Using things like:
var userContactId = Terrasoft.SysValue.CURRENT_USER_CONTACT.value;
To get the current user applies whether the user is a portal user or not.



