diff options
| author | Max Git <rotvel@gmail.com> | 2020-06-15 12:12:03 +0200 |
|---|---|---|
| committer | Max Git <rotvel@gmail.com> | 2020-06-15 12:12:03 +0200 |
| commit | 37e737e0124540e9f4a615285bd0f5c16ffbf9eb (patch) | |
| tree | 69fc9707a6a8fff6e9bd4204c91fd7555633171e /Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | |
| parent | 0f69ca8fa904447077fcf5319119f74702c0542a (diff) | |
| parent | 100e9d586dff877610c488936aa035f61f6fedb5 (diff) | |
Merge from master & fix conflict
Diffstat (limited to 'Jellyfin.Api/Auth/CustomAuthenticationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs index aab1141ee..767ba9fd4 100644 --- a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs +++ b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs @@ -3,6 +3,7 @@ using System.Security.Claims; using System.Text.Encodings.Web; using System.Threading.Tasks; using Jellyfin.Api.Constants; +using Jellyfin.Data.Enums; using MediaBrowser.Controller.Net; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; @@ -49,10 +50,10 @@ namespace Jellyfin.Api.Auth var claims = new[] { - new Claim(ClaimTypes.Name, user.Name), + new Claim(ClaimTypes.Name, user.Username), new Claim( ClaimTypes.Role, - value: user.Policy.IsAdministrator ? UserRoles.Administrator : UserRoles.User) + value: user.HasPermission(PermissionKind.IsAdministrator) ? UserRoles.Administrator : UserRoles.User) }; var identity = new ClaimsIdentity(claims, Scheme.Name); var principal = new ClaimsPrincipal(identity); |
