aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-22 21:19:04 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-01-22 21:19:04 -0500
commit4ce43ce019e24344f08ee6743c0efef7a03875a9 (patch)
treec4b3cfb8636f5207cf8e40b0f39ee1f0504c84c7 /MediaBrowser.Api/Playback/BaseStreamingService.cs
parentbd0a1b70d0fb293609683076f325cf655ef369ac (diff)
fixes #683 - Support disabling playback per user
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 6761c272d..394ca69d5 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -1007,6 +1007,13 @@ namespace MediaBrowser.Api.Playback
throw new InvalidOperationException("You asked for a debug error, you got one.");
}
+ 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)