IAuthorizationHandlerContextFactory.CreateContext Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a AuthorizationHandlerContext used for authorization.
public:
Microsoft::AspNetCore::Authorization::AuthorizationHandlerContext ^ CreateContext(System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object? resource);
abstract member CreateContext : seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> * System.Security.Claims.ClaimsPrincipal * obj -> Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext
Public Function CreateContext (requirements As IEnumerable(Of IAuthorizationRequirement), user As ClaimsPrincipal, resource As Object) As AuthorizationHandlerContext
Parameters
- requirements
- IEnumerable<IAuthorizationRequirement>
The requirements to evaluate.
- user
- ClaimsPrincipal
The user to evaluate the requirements against.
- resource
- Object
An optional resource the policy should be checked with. If a resource is not required for policy evaluation you may pass null as the value.
Returns
The AuthorizationHandlerContext.