Skip to main content
.NET Framework 4.5.2+

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

Declaration

public virtual bool IsGranted(
    IPermissionRequest permissionRequest,
    IPermissionPolicyRole targetRole
)

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.

See Also