Purpose: The purpose of this document is to discuss how to show the Security Maintenance Dialog (SecurityDialog) within your application to allow the end-users of your application to maintain roles and users.
The SecurityDialog
The same security maintenance dialog that is used within the design-time role-based security editor can be shown within your application to allow end-users to maintain users and roles within their database. This form is the MicroFour.StrataFrame.Security.SecurityDialog form. There are several overloads to the constructor of this dialog, but only 2 of them can be used at runtime.
The SecurityDialog behaves differently at runtime than it does at design-time. Since permissions are defined by the developer and must be tied into the application, it is not logical for end-users to be able to define new permissions or alter existing ones. However, end-users should be able to create or alter users, roles, and optionally restriction sets. Therefore, while permissions can be shown within the SecurityDialog at runtime, they cannot be edited.
The following samples can be used to show the SecurityDialog within your application. The default constructor for the SecurityDialog class will allow both the permissions and the restriction sets to be visible within the dialog. The second overload accepts two Boolean arguments: the first determines whether the permissions will be visible, the second determines whether the restriction sets will be visible and editable.
Code Samples
Showing the Security Dialog
Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
'-- Create the form and show it
Using loDialog As New SecurityDialog()
loDialog.ShowDialog()
End Using
End Subusing MicroFour.StrataFrame.Security;
...
private void ShowSecurityDialog()
{
//-- Create the form and show it
using (SecurityDialog loDialog = new SecurityDialog())
{
loDialog.ShowDialog();
}
}Showing the SecurityDialog Without Permissions or Restriction Sets
Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
'-- Create the form and show it
Using loDialog As New SecurityDialog()
loDialog.ShowDialog(False, False)
End Using
End Subusing MicroFour.StrataFrame.Security;
...
private void ShowSecurityDialog()
{
//-- Create the form and show it
using (SecurityDialog loDialog = new SecurityDialog())
{
loDialog.ShowDialog(false, false);
}
}