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
NuGet Package: DevExpress.ExpressApp.Security
Declaration
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 |
|
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