Field level security information is exposed on the browser side.
Use the following function to retrieve a user's field level security for a given service or Navigation Key:
top.getFieldLevelSecurityInfo(serviceNameOrNavigationKey)
, which
returns an Object keyed by security type.
The following example illustrates how to implement security for adjustment amount on the client. In the example, User Group 1 is authorized to freeze adjustments less than $10,000, and User Group 2 can authorize any adjustment. We want to disable the Freeze button if the user's security doesn't meet the condition. There is a security type ADJAMT defined for the Adjustment Maintenance.
The following example code would be added to the extPreOnWindowLoad
user
exit:
var secInfo = top.getFieldLevelSecurityInfo("adjustmentMaint");
var adjAmtSecInfo = secInfo["ADJAMT"];
if (adjAmtSecInfo < "2" && parseFloat(model.getValue("ADJ_AMT")) > 10000 ) {
//disable the field
protectField("FREEZE_SW")
}