diff options
| author | Anthony Lavado <anthony@lavado.ca> | 2020-06-14 18:31:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-14 18:31:27 -0400 |
| commit | 15aea76523d1ad36ac4a1c8850bd099882c6325d (patch) | |
| tree | ba0d1f6fb725a803d0cea6e0f96d6cb7321bcc3f /MediaBrowser.Api/BaseApiService.cs | |
| parent | 403cd3205ffb970cfda88b6c49dc69127fada798 (diff) | |
| parent | 42b4f0aa2e299e7eda9c8e4a6a4ed88380a43148 (diff) | |
Merge pull request #3148 from barronpm/userdb-efcore
Migrate User DB to EF Core
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."); } |
