aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/BaseApiService.cs
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2020-06-19 12:32:38 +0200
committerDavid <daullmer@gmail.com>2020-06-19 12:32:38 +0200
commit42385a14f055cdb648c8a96674c34877c076f4f1 (patch)
treeffd7d87ecf1d0ed676f2e25c99f87ec70bd90a03 /MediaBrowser.Api/BaseApiService.cs
parent8a8bf4b6866e804c60baace62dbda9b690c5ece7 (diff)
parent522e44de59a8661a859f6a373e495a9e0e8d13ff (diff)
Merge remote-tracking branch 'remotes/upstream/api-migration' into api-sessionservice
# Conflicts: # MediaBrowser.Api/Sessions/SessionService.cs
Diffstat (limited to 'MediaBrowser.Api/BaseApiService.cs')
-rw-r--r--MediaBrowser.Api/BaseApiService.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 2cd68ac1b..2ece16ee1 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Linq;
+using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
@@ -94,8 +95,8 @@ namespace MediaBrowser.Api
var authenticatedUser = auth.User;
// If they're going to update the record of another user, they must be an administrator
- if ((!userId.Equals(auth.UserId) && !authenticatedUser.Policy.IsAdministrator)
- || (restrictUserPreferences && !authenticatedUser.Policy.EnableUserPreferenceAccess))
+ if ((!userId.Equals(auth.UserId) && !authenticatedUser.HasPermission(PermissionKind.IsAdministrator))
+ || (restrictUserPreferences && !authenticatedUser.EnableUserPreferenceAccess))
{
throw new SecurityException("Unauthorized access.");
}