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

    IsGrantedExtensions.CanCreate<T>(IRequestSecurityStrategy, IObjectSpace) Method

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

    Namespace: DevExpress.ExpressApp.Security

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

    Declaration

    public static bool CanCreate<T>(
        this IRequestSecurityStrategy security,
        IObjectSpace objectSpace
    )

    Parameters

    Name Type Description
    security IRequestSecurityStrategy

    An object that specifies the application’s security strategy.

    objectSpace IObjectSpace

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

    Type Parameters

    Name Description
    T

    The object’s type.

    Returns

    Type Description
    Boolean

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

    Remarks

    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.Security;
    // ...
    public class CheckCreatePermissionController : ViewController<ListView> {
        protected override void OnActivated() {
            base.OnActivated();
            SecurityStrategy securityStrategy = Application.GetSecurityStrategy();
            if (!securityStrategy.CanCreate<Contact>(ObjectSpace)) {
                // ...  
            }
        }
    }
    
    See Also