fixes #683 - Support disabling playback per user

This commit is contained in:
Luke Pulverenti
2014-01-22 21:19:04 -05:00
parent bd0a1b70d0
commit 4ce43ce019
3 changed files with 20 additions and 0 deletions

View File

@@ -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)