Examples of EL Expressions

You can use EL expressions to configure the visibility settings of various elements like groups, page entries, infolets, or announcements on the UI for users with specific roles.

For example, you can use EL expressions to show or hide a group or page entry on the Navigator and the home page, or show or hide an infolet or an announcement on the home page. The evaluation of the EL expression decides whether these elements are displayed for users with specific roles.

Scenario

This table shows examples of how you can use EL Expressions to show or hide specific UI elements for specific users.

Who can see the group or page entries

EL Expression and Example

Only users having any of the specific roles

#{securityContext.userInRole['<Role_Name>']}

#{securityContext.userInRole['CUSTOM_FND_APPLICATION_ADMINISTRATOR_JOB,CUSTOM_SVC_INTERNAL_HELP_DESK_MANAGER_JOB']}

Only users not having any of the specific roles

#{!(securityContext.userInRole['<Role_Name>']}

#{!(securityContext.userInRole['CUSTOM_FND_APPLICATION_ADMINISTRATOR_JOB,CUSTOM_SVC_INTERNAL_HELP_DESK_MANAGER_JOB'])}

Only users having all of the specific roles

#{securityContext.userInAllRoles['<Role_Name>']}

#{securityContext.userInAllRoles['CUSTOM_FND_APPLICATION_ADMINISTRATOR_JOB,CUSTOM_SVC_INTERNAL_HELP_DESK_MANAGER_JOB']}

Only users not having all of the specific roles

#{!(securityContext.userInAllRoles['<Role_Name>']}

#{!(securityContext.userInAllRoles['CUSTOM_FND_APPLICATION_ADMINISTRATOR_JOB,CUSTOM_SVC_INTERNAL_HELP_DESK_MANAGER_JOB'])}

Here are a few things to keep in mind when you use EL expressions.

  • Use an EL expression that can be evaluated from any page because the Navigator is used on all pages. So, don't use product-specific EL expressions.

  • Don't include spaces or double quotes in EL expressions.

  • Don't copy EL expressions from a word document and paste directly in the expression editor. Doing so might introduce hidden characters in your EL expression, causing formatting issues and unexpected action. Instead, use a text editor or manually type the EL expression in the editor.