SecuritySystem.CurrentUser Property
Gets the user who is currently logged on.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
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