.NET Standard 2.0+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET 5.0+

SecuritySystemUser Class

An XAF user who has a list of associated security roles.

Namespace: DevExpress.ExpressApp.Security.Strategy

Assembly: DevExpress.ExpressApp.Security.Xpo.v21.2.dll


[RuleCriteria("SecuritySystemUser_XPO_Prevent_delete_logged_in_user", DefaultContexts.Delete, "[Oid] != CurrentUserId()", "Cannot delete the current logged-in user. Please log in using another user account and retry.")]
public class SecuritySystemUser :



It is recommended to use the Allow/Deny Permission Policy. For this purpose, migrate from SecuritySystemUser to PermissionPolicyUser. If you use Entity Framework as the ORM system, you may also need to perform a migration.

Associated roles are exposed via the SecuritySystemUser.Roles property. To get the complete list of permissions granted to the current user via their associated roles, use the IOperationPermissionProvider.GetPermissions method.

Inherit this class when you use the SecurityStrategyComplex Security Strategy and want to replace the default SecuritySystemUser user with a custom type that exposes additional properties.

using DevExpress.ExpressApp.Security;
// ...
public class Employee : SecuritySystemUser {
    public Employee(Session session) : base(session) { }
    private string fullName;
    public string FullName {
        get { return fullName; }
        set { SetPropertyValue(nameof(FullName), ref fullName, value); }
    private Department department;
    public Department Department {
        get { return department; }
        set { SetPropertyValue(nameof(Department), ref department, value); }
    public XPCollection<Task> Tasks {
        get { return GetCollection<Task>(nameof(Tasks)); }

Then, invoke the Application Designer, focus the SecurityStrategyComplex component and change the SecurityStrategy.UserType value in the Properties window.


Alternativaly, you can specify the user type in code. In a Windows Forms application project, modify the Program.cs (Program.vb) file in the following manner.

public static void Main(string[] arguments) {
    MySolutionWinApplication winApplication = new MySolutionWinApplication();
    winApplication.Security = 
        new SecurityStrategyComplex(typeof(Employee), typeof(SecuritySystemRole), 
            new AuthenticationStandard());
    // ...

In an ASP.NET Web Forms application project, modify the Global.asax.cs (Global.asax.vb) file in the following manner.

protected void Session_Start(Object sender, EventArgs e) {
    WebApplication.SetInstance(Session, new MySolutionAspNetApplication());
    WebApplication.Instance.Security = 
       new SecurityStrategyComplex(typeof(Employee), typeof(SecuritySystemRole), 
            new AuthenticationStandard());
    // ...

If server-side security is used, change the security settings in a QueryRequestSecurityStrategyHandler handler.

QueryRequestSecurityStrategyHandler securityProviderHandler = delegate() {
    return new SecurityStrategyComplex(
        typeof(Employee), typeof(SecuritySystemRole), new AuthenticationStandard());

More examples on implementing a custom user object are provided in the How to: Implement Custom Security Objects (Users, Roles, Operation Permissions) and How to: Use Custom Logon Parameters and Authentication topics.


You can use the UserWithRolesExtensions.IsUserInRole extension method with SecuritySystemUser objects because SecuritySystemUser implements ISecurityUserWithRoles.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SecuritySystemUser class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also