diff options
| author | aled <aled@wibblr.com> | 2020-06-16 19:30:00 +0100 |
|---|---|---|
| committer | aled <aled@wibblr.com> | 2020-06-16 19:30:23 +0100 |
| commit | 05f736defb9b045ace57262d19ec3691414f8bfc (patch) | |
| tree | add6734a2275aeaa887d459153c7bab4b18ff61a /Jellyfin.Api/Auth/CustomAuthenticationHandler.cs | |
| parent | c722ad22ece5ee7dd68b41521c2716a50364f42a (diff) | |
| parent | 100e9d586dff877610c488936aa035f61f6fedb5 (diff) | |
Merge branch 'master' into check-stored-password-exists
# Conflicts:
# Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
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); |
