The user
variable provides information about the user's authentication status when the custom component appears on the page.
The structure of user
is as follows:
{
"isAuthenticated": true,
"roles": [
"OFFLINE_USER",
"PERSONAL_BOOK_USER",
"PRINT_USER",
"PERSONAL_BOOK_SHARE_USER",
"BETA_USER",
"COLLECTION_USER",
"ANALYTICS_USER",
"CONTENT_PUBLISHER",
"FEEDBACK_USER",
"RATING_USER",
"ADMIN",
"USERS_ADMIN",
"PDF_EXPORT_USER",
"KHUB_ADMIN",
"HTML_EXPORT_USER",
"SAVED_SEARCH_USER",
"PORTAL_ADMIN",
"DEBUG_USER"
],
"profile": {
"id": "6d346375-8f99-4248-acf0-ec84ebeb60cc",
"displayName": "John Doe",
"emailAddress": "john.doe@example.com"
}
}
Field | Type | Description |
---|---|---|
isAuthenticated |
Boolean | Indicates whether the user is authenticated or not. |
roles |
Array | Lists the roles the user has. |
profile |
Object | Information about the profile of the user. |
id |
String | The ID of the user, used in the Fluid Topics API (for example, in the Get a user's personal information and assets web service). |
displayName |
String | The display name of the user. |
emailAddress |
String | The email address of the user. |
If the user is not authenticated, the profile field is undefined, but roles may still be present.
This feature only affects the displayed content. It should not be considered a security measure and should in no case be used to hide sensitive information.
For an example on how to use the user
variable, see User bookmarks example.