Permissions and Visibility in the EUI
User permissions determine which elements on the EUI are visible to each user. Oftentimes, you may have several groups of users, and you want the different groups to see different elements on the interface. In other cases, you may want the same user to see different parts of a record based on the the page they're viewing. For example, when a user is submitting a support case, you might not show the Created By field because it isn't relevant. In either case, understanding how permissions control visibility in the EUI can help you create an interface that suits your needs.
Prerequisites
Before making changes to the EUI, we recommend that you have a basic understanding of the following topics:
- HTML
- CSS
- Macros, methods, and conditionals, as they're used in the EUI
For more information on HTML and CSS, visit W3 Schools.
Controlling Visibility
The interface that a user sees depends on two factors:
- Their group permissions.
- The status of a table or menu tab in the
translation.properties
file. Tables and menu tabs can be turned on if their value is Yes and turned off if their value is No. If a table or menu tab is not turned on, end users will not see it, regardless of their permissions.
To illustrate this, the three images below show the home page contents for three different users: one in the Admin group, one in the Document Creator group, and one in the Customer group. Each user sees a different interface based on their permissions. Notice that not even the user in the Admin group sees the Change Requests or Tasks tables, which are turned off in these examples.
A user in the Admin group sees six tables and sets of links:
A user in the Document Creator group sees four tables and sets of links:
A user in the Customer group sees two tables and sets of links:
Control Visibility with Permissions
When users log in, the system checks their group permissions and uses the $ewPermission.table
method to determine which EUI elements they see. This method requires two parameters, the logical table name and the permission type, which take the form $ewPermission.table("table","permission")
. For example, $ewPermission.table("case","view_own")
returns “true” if the currently logged in user user has permission to view their own records in the Support Cases table.
The logical table name might be different from the table name that's displayed. To find the logical table name, open the Table wizard for the desired table and check the General tab.
You can insert the $ewPermission.table
method in a conditional that surrounds an element, such as a link or menu item. Conditionals are used throughout the records in the EUI Templates table to dynamically control element visibility based on group permissions. For example, consider the following conditional:
#if ($ewPermission.table("case","view_own")) <li><a href='#ew_forward("my_supportcases.html")'>$ewText.get('menu.view.mysc')</a></li> #end
If the user has permission to view their own records in the Support Cases table, the system shows the user a menu item to view a page containing support cases that they own.
To control which permissions control the display of an element:
- In the EUI Templates table, open the desired template file.
Find the method that relates to the relevant table and element.
- Edit the permission in the second parameter, or add a logical operator to expand the conditional. For a complete list of permission types, see Permission Parameters below. For more information on conditionals and the available logical operators, see Macros, Methods, and Conditionals.
- Click Save.
- View the EUI page with the relevant user to verify that the element visibility is working as intended.
Control Visibility with translation.properties
The translation.properties
file in the EUI Templates table controls the global visibility for tables and menu tabs by turning on or turning off specific tables and tabs. For users to see a table or menu tab in the EUI, it must be turned on in translation.properties
. To prevent all users from seeing a table or menu tab, you can turn it off.
Th translation.properties
file has alternate versions for other languages, which allow for a multilingual environment. If your KB is available in multiple languages, be sure to update the keys in each translation file when making changes. For more information on localization and the EUI, see Text and Localization in the EUI.
Table visibility is controlled near the top of the template file, and menu tab visibility is controlled just below the table visibility section. If the show.[table.or.tab] key is set to Yes for a given table or tab, then it's included in the interface for those users with permission to view it. If show.[item] is set to No, it's not shown on the home page or navigation menu to any users, regardless of their permissions.
To control global visibility for tables and tabs:
- In the EUI Templates table, open
translation.properties
. - Set the relevant table and menu tab keys to Yes or No.
- Click Save.
- If other languages are in use, open any other versions of
translation.properties
and repeat the process. - View the EUI to confirm that changes have taken effect.
Keep in mind that whether a user can actually view a table or the items within a tab still depends on the user’s group permissions.
Permission Parameters
The table below lists the most common permission-based parameters for use with the $ewPermission.table
method. Each of these values corresponds to a permission setting in the Table Permissions wizard.
Permission Type | Description |
---|---|
create | Create records in the table |
edit_own | Edit their own records in the table |
e_own_with_ssearch | Edit only their own records matching a saved search |
delete_own | Delete their own records in the table |
view_own | View their own records in the table |
v_own_with_ssearch | View only their own records matching a saved search |
view_others | View other people’s records in the table |
v_oth_with_ssearch | View only others’ records matching a saved search |
view_faq | View FAQs from the table |
view_faq_with_ss | View only FAQs matching a saved search |
The table below lists the complete list of permission-based parameters.