diff options
| author | David <daullmer@gmail.com> | 2020-06-19 12:32:38 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-06-19 12:32:38 +0200 |
| commit | 42385a14f055cdb648c8a96674c34877c076f4f1 (patch) | |
| tree | ffd7d87ecf1d0ed676f2e25c99f87ec70bd90a03 /MediaBrowser.Api/BaseApiService.cs | |
| parent | 8a8bf4b6866e804c60baace62dbda9b690c5ece7 (diff) | |
| parent | 522e44de59a8661a859f6a373e495a9e0e8d13ff (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.cs | 5 |
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."); } |
