The requested page is not available for the requested platform. You are viewing the content for Default platform.

SecuritySystem.CurrentUser Property

Gets the user who is currently logged on.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.1.dll

Declaration

public static object CurrentUser { get; }
Public Shared ReadOnly Property CurrentUser As Object

Property Value

Type Description
Object

An object that is the user who is currently logged on.

Remarks

The example below demonstrates how to invoke the current user's Detail View via a PopupWindowShowAction.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
// ...
public class ShowCurrentUserController : WindowController {
    public ShowCurrentUserController() {
        PopupWindowShowAction showCurrentUserAction = new PopupWindowShowAction(
        this, "ShowCurrentUser", PredefinedCategory.Edit);
        showCurrentUserAction.CustomizePopupWindowParams += ShowCurrentUserAction_CustomizePopupWindowParams;
    }
    private void ShowCurrentUserAction_CustomizePopupWindowParams(
        object sender, CustomizePopupWindowParamsEventArgs e) {
        IObjectSpace newObjectSpace = Application.CreateObjectSpace(SecuritySystem.CurrentUser.GetType());
        object currentUser = newObjectSpace.GetObject(SecuritySystem.CurrentUser);
        e.View = Application.CreateDetailView(newObjectSpace, currentUser);
    }
}
See Also