isAnonymous (DirectoryUser - JavaScript)

Checks if the directory user is an Anonymous.

Syntax

isAnonymous() : boolean
Return value Description
boolean true if the directory user is anonymous; false otherwise

Example

This computed field displays a message if the current user is Anonymous.
if(context.getUser().isAnonymous()) {
	return "Anonymous user"
} else {
	return context.getUser().getCommonName()
}