aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-14 20:15:26 -0600
committercrobibero <cody@robibe.ro>2020-06-14 20:15:26 -0600
commit589735f60ce36197be9d1c4609b0ee6e3fd3c291 (patch)
treec5dad758fee4f4eb7727780fd7eab0fa60630a71 /Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
parente2b2f74b47cc1d281c0819795b83f8d49d1f3b09 (diff)
parentf026a1d7217c69b4eeadd258980e254702f6dde6 (diff)
Merge remote-tracking branch 'upstream/master' into HEAD
Diffstat (limited to 'Jellyfin.Api/Auth/CustomAuthenticationHandler.cs')
-rw-r--r--Jellyfin.Api/Auth/CustomAuthenticationHandler.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs b/Jellyfin.Api/Auth/CustomAuthenticationHandler.cs
index 100054096..a5c4e9974 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;
@@ -56,10 +57,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);