Added UserClaimsPrincipal to ViewComponent

Addresses #4964
This commit is contained in:
Jass Bagga 2016-11-02 10:30:22 -07:00 committed by GitHub
parent 32710bbfbe
commit ea701f2cd6
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Security.Claims;
using System.Security.Principal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ModelBinding;
@ -60,6 +61,11 @@ namespace Microsoft.AspNetCore.Mvc
}
}
/// <summary>
/// Gets the <see cref="ClaimsPrincipal"/> for the current user.
/// </summary>
public ClaimsPrincipal UserClaimsPrincipal => ViewContext?.HttpContext?.User;
/// <summary>
/// Gets the <see cref="RouteData"/> for the current request.
/// </summary>