Attribute:
Use Security: With this option selected, the application is only accessible when the sc_apl_status
macro is enabled. Disabled applications display the message "Unauthorized user" when accessed.
Access to applications may be granted through a control application to authenticate users. See the examples
below.
Example 1: Activating an application called grid_categories.
In the login application onValidate event (control form application used to authenticate a
user), insert the following macro call:
sc_apl_status('grid_categories','on'); |
In the login application onValidate event (control form application used to authenticate a user), insert the following code:
// two users: john and mary with permission to access different applications
if({userid} == 'john') {
sc_apl_status('grid_categories','on');
sc_apl_status('form_categories','on');
sc_apl_status('grid_products','on');
sc_apl_status('form_products','on');
}
elseif({userid} == 'mary') {
sc_apl_status('grid_categories','on');
sc_apl_status('form_categories','on');
sc_apl_status('grid_products','off');
sc_apl_status('form_products','off');
}
else{
sc_error_message("Unauthorized user!");
}
Example 3: Authenticating applications using a database table.
In the login application onValidate event, enter the following code:
|
In the development environment it is possible to suppress the above steps purely for testing purposes, thereby avoiding repeated password requests (or access denied) for each application execution. Disable the options Enable use of security and Enable Use of Password in the Configuration menu | My ScriptCase.