Purpose: This document describes the process of retrieving the global security preferences from the database and storing them in the proper shared (static) properties of the SecurityBasics class.
Retrieving Global Preferences
Global preferences are stored within the database in the SFSPreferences table; however, all global preferences are referenced through shared (static) properties on the SecurityBasics class. The MicroFour.StrataFrame.Security.BusinessObjects.SFSPreferencesBO.RetrieveSecurityPreferences() method is provided to retrieve all of the global security preferences from the SFSPreferences table and store them in the appropriate properties on the SecurityBasics class. For more information on the global preferences, click here.
The RetrieveSecurityPreferences() method should be called after the SecurityDataSourceKey property is set to ensure that the SFSPreferencesBO object can access the SFSPreferences table. The RetrieveSecurityPreferences() method is generally called within the InitApplication() method of the AppMain.vb (Program.cs) file. The following sample shows an example of calling the RetrieveSecurityPreferences() method.
Imports MicroFour.StrataFrame.Security.BusinessObjects ... Private Shared Sub InitApplication(ByVal e As InitializingApplicationEventArgs) '-- Retrieve the security preferences SFSPreferencesBO.RetrieveSecurityPreferences() End Sub
using MicroFour.StrataFrame.Security.BusinessObjects;
...
private static void InitApplication(InitializingApplicationEventArgs e)
{
//-- Retrieve the security preferences
SFSPreferencesBO.RetrieveSecurityPreferences();
}