Checks if the current principal is authorized to perform the specified action on the specified resource.
Assembly: System.IdentityModel.Services (in System.IdentityModel.Services.dll)
The principal must be authorized for the specified action on the specified resource or the SecurityException exception is thrown.
The ClaimsAuthorizationManager.CheckAccess method of the configured claims authorization manager is invoked with an AuthorizationContext composed of the active principal (CurrentPrincipal), the resource, and the action.
The following example shows how to protect a resource by using the method. The configured claims authorization manager is invoked to evaluate the current principal against the specified resource and action. If the current principal is not authorized for the specified action on the specified resource, a SecurityException is thrown; otherwise, execution proceeds.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.