Skip to main content
All docs
V25.1
  • .NET Framework 4.6.2+

    IsGrantedExtensions.CanDelete(IRequestSecurityStrategy, Type, IObjectSpace) Method

    Checks whether the current user can delete objects of the specified type.

    Namespace: DevExpress.ExpressApp.Security

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

    Declaration

    public static bool CanDelete(
        this IRequestSecurityStrategy security,
        Type type,
        IObjectSpace objectSpace
    )

    Parameters

    Name Type Description
    security IRequestSecurityStrategy

    An object that specifies the application’s security strategy.

    type Type

    An object type.

    objectSpace IObjectSpace

    An Object Space used to obtain data to calculate this security criterion.

    Returns

    Type Description
    Boolean

    true, if the current user can delete objects of the specified type; otherwise, false.

    Remarks

    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.Security;
    // ...
    public class CheckDeletePermissionController : ObjectViewController<ListView, Contact> {
        protected override void OnActivated() {
            base.OnActivated();
            SecurityStrategy securityStrategy = Application.GetSecurityStrategy();
            if (!securityStrategy.CanDelete(typeof(Department), ObjectSpace)) {
                // ...
            }
        }
    }
    
    See Also