ftos.context.getAdminMode
IMPORTANT!
Starting with v24.3.0, this is renamed from getAdminMode to ftos.context.getAdminMode.
Starting with v24.3.0, this is renamed from getAdminMode to ftos.context.getAdminMode.
Checks the if the context of the current transaction is administrator. Also see ftos.context.setAdminMode.
This is a method suitable for all business service components.
Syntax
function ftos.context.getAdminMode(): boolean
Return Value
- true – The context of the current transaction is administrator.
- false – The context of the current transaction is not administrator.
Examples
In this example:
- If the transaction context is administrator, we display a Welcome message.
- Otherwise, we display the following message: You don't have enough privileges for this operation. Please contact an administrator.
- For details on how to display messages, see ftos.context.response.setMessage.
if (ftos.context.getAdminMode()) {
ftos.context.response.setMessage('Welcome');
} else {
ftos.context.response.setMessage('You don\'t have enough privileges for this operation. Please contact an administrator.')
};