Skip to main content
.NET 6.0+

SecurityModule.NonSecureActionsInitializing Event

Occurs before the Security System initializes the collection of non-secure Actions. The Security System ignores these Actions and you cannot manage them in the Denied Actions tab in the UI.

Namespace: DevExpress.ExpressApp.Security

Assembly: DevExpress.ExpressApp.Security.v23.2.dll

Declaration

public event EventHandler<NonSecureActionsInitializingEventArgs> NonSecureActionsInitializing

Event Data

The NonSecureActionsInitializing event's data class is NonSecureActionsInitializingEventArgs. The following properties provide information specific to this event:

Property Description
NonSecureActions Contains Actions that the Security System ignores. You cannot manage them in the Denied Actions tab in the UI.

Remarks

The Security System marks built-in Actions as non-secure and hides them in the Denied Actions tab. The NonSecureActionsInitializing event allows you to customize a list of non-secure Actions. Add custom or remove system Action identifiers from the NonSecureActions collection to manage whether these Actions are available in the Denied Actions tab.

You can find an Action’s identifier in the Model Editor:

To add a ChoiceActionItem to the NonSecureActions collection, use its complex identifier that includes dot-separated identifiers of all parent items. For example, the choiceActionItem from the following Controller has the “MySingleChoiceActionId.MyChoiceActionItemId“ complex identifier.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
// ...
public class MyController : ViewController {
    // ...
    public MyController() {
        // ...
        SingleChoiceAction MySingleChoiceAction = new SingleChoiceAction(this, "MySingleChoiceActionId", null);
        ChoiceActionItem MyChoiceActionItem = new ChoiceActionItem("MyChoiceActionItemId", null)
        MySingleChoiceAction.Items.Add(MyChoiceActionItem);
    }
}

The following code shows how to add and remove Action identifiers from the NonSecureActions collection.

using DevExpress.ExpressApp.Security;
using DevExpress.ExpressApp.Win;
// ...
public partial class MySolutionWin : WinApplication {
    public MySolutionWin() {
        // ...
        securityModule1.NonSecureActionsInitializing += securityModule1_NonSecureActionsInitializing;
    }
    // ...
    private void securityModule1_NonSecureActionsInitializing(object sender, 
    NonSecureActionsInitializingEventArgs e) {
        // SimpleAction, PopupWindowShowAction, or ParametrizedAction 
        e.NonSecureActions.Add("Demo About Info");
        e.NonSecureActions.Remove("Export");
        // ChoiceActionItem
        e.NonSecureActions.Add("SetTaskAction.Priority"); 
    }
}
See Also