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 /Emby.Notifications/Api/NotificationsService.cs | |
| parent | 403cd3205ffb970cfda88b6c49dc69127fada798 (diff) | |
| parent | 42b4f0aa2e299e7eda9c8e4a6a4ed88380a43148 (diff) | |
Merge pull request #3148 from barronpm/userdb-efcore
Migrate User DB to EF Core
Diffstat (limited to 'Emby.Notifications/Api/NotificationsService.cs')
| -rw-r--r-- | Emby.Notifications/Api/NotificationsService.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Emby.Notifications/Api/NotificationsService.cs b/Emby.Notifications/Api/NotificationsService.cs index 788750796..1ff8a5026 100644 --- a/Emby.Notifications/Api/NotificationsService.cs +++ b/Emby.Notifications/Api/NotificationsService.cs @@ -8,6 +8,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Jellyfin.Data.Enums; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Notifications; @@ -149,9 +150,7 @@ namespace Emby.Notifications.Api [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "request", Justification = "Required for ServiceStack")] public object Get(GetNotificationsSummary request) { - return new NotificationsSummary - { - }; + return new NotificationsSummary(); } public Task Post(AddAdminNotification request) @@ -164,7 +163,10 @@ namespace Emby.Notifications.Api Level = request.Level, Name = request.Name, Url = request.Url, - UserIds = _userManager.Users.Where(i => i.Policy.IsAdministrator).Select(i => i.Id).ToArray() + UserIds = _userManager.Users + .Where(user => user.HasPermission(PermissionKind.IsAdministrator)) + .Select(user => user.Id) + .ToArray() }; return _notificationManager.SendNotification(notification, CancellationToken.None); |
