diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 21:19:04 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 21:19:04 -0500 |
| commit | 4ce43ce019e24344f08ee6743c0efef7a03875a9 (patch) | |
| tree | c4b3cfb8636f5207cf8e40b0f39ee1f0504c84c7 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | bd0a1b70d0fb293609683076f325cf655ef369ac (diff) | |
fixes #683 - Support disabling playback per user
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 7 |
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) |
