Back to Devexpress

Role Class

expressappframework-devexpress-dot-persistent-dot-baseimpl-dot-ef-5337520c.md

latest2.9 KB
Original Source

Role Class

An entity that defines the security role.

Namespace : DevExpress.Persistent.BaseImpl.EF

Assembly : DevExpress.ExpressApp.Security.EF6.v25.1.dll

NuGet Package : DevExpress.ExpressApp.Security.EF6

Declaration

csharp
public class Role :
    ISecurityRole,
    IOperationPermissionProvider,
    ISecuritySystemRole
vb
Public Class Role
    Implements ISecurityRole,
               IOperationPermissionProvider,
               ISecuritySystemRole

Remarks

Note

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

In XAF applications, permissions are not assigned to a user directly. Users have roles, which in turn are characterized by a permission set. So, each user has one or more roles that determine what actions can be performed. The list of users associated with the current role is exposed via the Role.Users property. Roles can be organized in a hierarchical structure. The Role.ParentRoles and Role.ChildRoles properties define this structure. In this instance, roles taken into account for the current user are:

  • roles that are directly assigned to the user;
  • all child roles of directly assigned roles (recursively).

For instance, you can specify a set of low-level roles, and then associate them with high-level roles. These high-level roles can be assigned to users.

Implements

IOperationPermissionProvider

Inheritance

Object Role

See Also

Role Members

DevExpress.Persistent.BaseImpl.EF Namespace