Click or drag to resize

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
public static event VGPermissionsLoadingEventHandler PermissionsLoading

Value

Type: Novalys.VisualGuard.SecurityVGPermissionsLoadingEventHandler
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
        }
    }
}
See Also