SecurityStrategy.IsGranted(IPermissionRequest, IPermissionPolicyRole) Method
Checks whether the specified role allows a user to make an operation.
Namespace: DevExpress.ExpressApp.Security
Assembly: DevExpress.ExpressApp.Security.v24.1.dll
NuGet Package: DevExpress.ExpressApp.Security
Declaration
Parameters
Name | Type | Description |
---|---|---|
permissionRequest | IPermissionRequest | An IPermissionRequest object that specifies the secured operation. |
targetRole | IPermissionPolicyRole | An IPermissionPolicyRole object that is a role this method checks. |
Returns
Type | Description |
---|---|
Boolean | true, if the specified role allows a user to make an operation; otherwise, false. |
Remarks
Tip
You can also use the IsGrantedExtensions class methods to check a role’s permissions. These methods do not require an IPermissionRequest object.
The passed Permission Request should have an appropriate Permission Request Processor registered within the Security Strategy. To register a Permission Request, handle the SecurityStrategy.CustomizeRequestProcessors event. Refer to the How to: Implement Custom Security Objects (Users, Roles, Operation Permissions) topic to see an example.