User Information

The userInfo contains the user information fetched by the Security Provider. 

For the default implementation, the userInfo has the following type:
{
  "userId": "string",
  "fullName": "string",
  "email": "string",
  "roles": "string[]",
  "permissions": "string[]",
  "isAuthenticated": "boolean"
}

The userInfo is made available to the application with the help of the $application.user built in variable. This allows content in the page to be rendered conditionally.

Example 1-74 Example of conditional content rendering

<!-- Render 'I am a manager' if manager is a role of the current user -->
<oj-bind-if test='[[!$application.user.roles.manager]]'>
    I am a manager
</oj-bind-if>


<!-- Render the 'Sign In' button if the current user is not authenticated -->
<oj-bind-if test='[[!$application.user.isAuthenticated]]'>
  <oj-button id='signIn' on-oj-action='[[$listeners.onSignIn]]'Sign In</oj-button>
</oj-bind-if>