aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-21 00:35:56 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-21 00:35:56 -0500
commit2ceea17bf424cf1ac8608b79e57f1c0ac1c65e42 (patch)
tree2e5ceaf7d2a9c03c189f09a053857a624a75abd1 /MediaBrowser.Api/Playback/BaseStreamingService.cs
parent7cd41a6ed62c46006307add9de92e0b329bd0edc (diff)
rework EnableMediaPlayback
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index da3f9be17..5b3221078 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -12,6 +12,7 @@ using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Library;
using MediaBrowser.Model.LiveTv;
using System;
using System.Collections.Generic;
@@ -1268,11 +1269,6 @@ namespace MediaBrowser.Api.Playback
var user = AuthorizationRequestFilterAttribute.GetCurrentUser(Request, UserManager);
- if (user != null && !user.Configuration.EnableMediaPlayback)
- {
- throw new ArgumentException(string.Format("{0} is not allowed to play media.", user.Name));
- }
-
var url = Request.PathInfo;
if (!request.AudioCodec.HasValue)
@@ -1288,6 +1284,11 @@ namespace MediaBrowser.Api.Playback
var item = DtoService.GetItemByDtoId(request.Id);
+ if (user != null && item.GetPlayAccess(user) != PlayAccess.Full)
+ {
+ throw new ArgumentException(string.Format("{0} is not allowed to play media.", user.Name));
+ }
+
if (item is ILiveTvRecording)
{
var recording = await LiveTvManager.GetInternalRecording(request.Id, cancellationToken).ConfigureAwait(false);