VGSecurityManagerPermissionsLoading Event
|
Occurs before the permissions are loaded and allows filtering the list of user's roles.
Namespace:
Novalys.VisualGuard.Security
Assembly:
Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2019.1.831.19 (2019.1.0831.19)
Syntax Remarks
The event handler receives an argument of type
VGPermissionsLoadingEventArgs containing data related to this event.
The
PermissionsLoading event allows a user to filter the list of roles granted to the principal or to cancel the authorization (or authentication) process.
Examples
This example display how to use the event
PermissionsLoading to allow the user select a roles in the list of granted roles.
private void OnPermissionLoading (object sender, VGPermissionsLoadingEventArgs args)
{
if (e.Roles.Length > 0)
SelectRoleForm form = new SelectRoleForm()
form.Roles = e.Roles
if (form.ShowDialog() == DialogResult.OK)
{
e.Roles = form.Roles
}
else
{
e.Cancel = true
}
}
}
Private Sub OnPermissionLoading(ByVal sender As Object, ByVal e As VGPermissionsLoadingEventArgs)
If e.Roles.Length > 0 Then
Dim form As New SelectRoleForm
form.Roles = e.Roles
If form.ShowDialog() = DialogResult.OK Then
e.Roles = form.Roles
Else
e.Cancel = True
End If
End If
End Sub
See Also