Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IPermissionRequest.GetHashObject() Method

Returns an object which is unique for each set of IPermissionRequest object’s property values.

Namespace: DevExpress.ExpressApp.Security

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

object GetHashObject()

#Returns

Type Description
Object

An object which is unique for each set of Permission Request property values.

#Remarks

The GetHashObject method implementation should satisfy the following requirements:

  • a returned object should be serializable;
  • a returned object should be the same for different IPermissionRequest instances with the same set of property values.

Generally, a combination of Permission Request property values can be used to calculate the unique hash object.

public class CustomOperationPermissionRequest : IPermissionRequest {
    public string Operation { get; set; }
    public Type ObjectType { get; private set; }
    public object GetHashObject() {
        return string.Format("{0}-{1}", ObjectType.FullName, Operation);
    }
}

In the simplest case, when your custom Permission Request exposes no properties, you can return the current object type.

public class MyPermissionRequest : IPermissionRequest {
    public object GetHashObject() {
        return this.GetType().FullName;
    }
}
See Also