I would like to illustrate here how to use an iCommand Display Template to Audit the role of the User such that the command can be carried out only by the Users with the specified role.
Certain operations like Delete/Update etc would be permitted only for certain roles of MII .
1.I am using a simple insert functionality to explain this.
On clicking the Submit Button the entered value will be inserted into the Database. This insert action is permitted only for a User with the role XMII Administrators
2. The Following function is assigned to the onclick parameter of the Submit button.
The part in bold is the code used to set the role Audit .
It makes sure that only Users with the role (in this case) “XMII Administrators” can perform the action.
3. When you click on the Submit button the following Pop Up Message appears.
4. The User has to enter his login credentials here. If it matches to the credentials of a User with role XMII Administrators in this case then the action is permitted. Otherwise the following error message is obtained.
Approach1:Setting Audit Directly in the iCommand
1. Open the iCommand Display template used for the action.
2. Select the Following options in the iCommand