Access rights

User-specific access rights defined in Description.json and configured in engineering should be checked and evaluated in Control.js/ts. Depending on the user-specific access rights, specific elements can be switched visible or invisible or enabled or disabled, for example.

The evaluation of the configured access rights is performed via the framework API function "TcHmi.Access.checkAccess()". The current instance of the control is passed to the function (this) and the name of the right to be checked, which must correspond to the definition in Description.json.

// check user access of "myCustomRight" that is defined in the description.json
if (TcHmi.Access.checkAccess(this, 'myCustomRight') === true) {
   // current user has the rights to do this

   // process actions with the right
   // show elements, enable buttons, etc.
} else {
   // Current user has no rights to do this

   // process actions without the rights
   // hide elements, disable buttons, etc.
}
Access rights 1:

Since user management only works when authentication is active, the configured functions are not available in normal live view. From version 1.12 a live view with authentication is offered.