DefaultAuthorizationHandlerContextFactory.CreateContext 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
AuthorizationHandlerContext建立用於授權的 。
public:
virtual Microsoft::AspNetCore::Authorization::AuthorizationHandlerContext ^ CreateContext(System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource);
public virtual Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object resource);
public virtual 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
override this.CreateContext : seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> * System.Security.Claims.ClaimsPrincipal * obj -> Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext
Public Overridable Function CreateContext (requirements As IEnumerable(Of IAuthorizationRequirement), user As ClaimsPrincipal, resource As Object) As AuthorizationHandlerContext
參數
- requirements
- IEnumerable<IAuthorizationRequirement>
要評估的需求。
- user
- ClaimsPrincipal
要評估需求的使用者。
- resource
- Object
應檢查原則的選擇性資源。 如果原則評估不需要資源,您可以傳遞 null 作為值。