aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Notifications
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2020-06-17 02:09:32 +0900
committerGitHub <noreply@github.com>2020-06-17 02:09:32 +0900
commitf5d82441a49c54022904603f2a7b196e48888f14 (patch)
treed34921899cf5ab1b8715a338c60f10b1cd309448 /MediaBrowser.Model/Notifications
parent3f58bd7c586e2816c1bb3afe7a165bb9d3f131ea (diff)
parent215ab39e00be3a79875351a76f0d836a9281ce6b (diff)
Merge branch 'master' into custom-repos
Diffstat (limited to 'MediaBrowser.Model/Notifications')
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOption.cs2
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOptions.cs7
2 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Model/Notifications/NotificationOption.cs b/MediaBrowser.Model/Notifications/NotificationOption.cs
index 144949a3b7..ea363d9b17 100644
--- a/MediaBrowser.Model/Notifications/NotificationOption.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOption.cs
@@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Notifications
public string Type { get; set; }
/// <summary>
- /// User Ids to not monitor (it's opt out)
+ /// User Ids to not monitor (it's opt out).
/// </summary>
public string[] DisabledMonitorUsers { get; set; }
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs
index 9e570ef1c3..239a3777e1 100644
--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs
@@ -2,7 +2,10 @@
#pragma warning disable CS1591
using System;
+using Jellyfin.Data.Enums;
+using MediaBrowser.Model.Extensions;
using System.Linq;
+using Jellyfin.Data.Entities;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Notifications
@@ -104,7 +107,7 @@ namespace MediaBrowser.Model.Notifications
!opt.DisabledMonitorUsers.Contains(userId.ToString(""), StringComparer.OrdinalIgnoreCase);
}
- public bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy)
+ public bool IsEnabledToSendToUser(string type, string userId, User user)
{
NotificationOption opt = GetOptions(type);
@@ -115,7 +118,7 @@ namespace MediaBrowser.Model.Notifications
return true;
}
- if (opt.SendToUserMode == SendToUserType.Admins && userPolicy.IsAdministrator)
+ if (opt.SendToUserMode == SendToUserType.Admins && user.HasPermission(PermissionKind.IsAdministrator))
{
return true;
}