diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 09a442966..bfa23b997 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -7,6 +7,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Session; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Library; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Session; using System; @@ -604,20 +605,20 @@ namespace MediaBrowser.Server.Implementations.Session { var session = GetSessionForRemoteControl(sessionId); + var items = command.ItemIds.Select(i => _libraryManager.GetItemById(new Guid(i))) + .Where(i => i.LocationType != LocationType.Virtual) + .ToList(); + if (session.UserId.HasValue) { var user = _userManager.GetUserById(session.UserId.Value); - if (!user.Configuration.EnableMediaPlayback) + if (items.Any(i => i.GetPlayAccess(user) != PlayAccess.Full)) { throw new ArgumentException(string.Format("{0} is not allowed to play media.", user.Name)); } } - var items = command.ItemIds.Select(i => _libraryManager.GetItemById(new Guid(i))) - .Where(i => i.LocationType != LocationType.Virtual) - .ToList(); - if (command.PlayCommand != PlayCommand.PlayNow) { if (items.Any(i => !session.QueueableMediaTypes.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase))) |
