diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs index cae2cead4..ac8e37902 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs @@ -67,7 +67,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security { if (!_config.Configuration.InsecureApps.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase)) { - //SessionManager.ValidateSecurityToken(auth.Token); + SessionManager.ValidateSecurityToken(auth.Token); } } @@ -80,9 +80,17 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security throw new ArgumentException("User with Id " + auth.UserId + " not found"); } - if (user != null && user.Configuration.IsDisabled) + if (user != null) { - throw new AuthenticationException("User account has been disabled."); + if (user.Configuration.IsDisabled) + { + throw new AuthenticationException("User account has been disabled."); + } + + if (!user.Configuration.IsAdministrator && !user.IsParentalScheduleAllowed()) + { + throw new AuthenticationException("This user account is not allowed access at this time."); + } } if (roles.Contains("admin", StringComparer.OrdinalIgnoreCase)) |
