diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-06-21 03:12:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-21 03:12:12 -0400 |
| commit | 680dd95292504c642ad04a571437785d6e0e4d05 (patch) | |
| tree | aa108fca60ad55fe60df26c51067e63e114d3d38 /Emby.Server.Implementations/HttpServer/Security/AuthService.cs | |
| parent | 3a5df3d06000a209e308f21cebf9aeb4c3fa9a5b (diff) | |
| parent | 82c1da34bee1d663bab053436f6a303d1910aef8 (diff) | |
Merge pull request #3394 from Ullmie02/fix-startupwizzard
Fix startup wizard in 10.6
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/Security/AuthService.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs index 2e6ff65a6..318bc6a24 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs @@ -51,6 +51,22 @@ namespace Emby.Server.Implementations.HttpServer.Security return user; } + public AuthorizationInfo Authenticate(HttpRequest request) + { + var auth = _authorizationContext.GetAuthorizationInfo(request); + if (auth?.User == null) + { + return null; + } + + if (auth.User.HasPermission(PermissionKind.IsDisabled)) + { + throw new SecurityException("User account has been disabled."); + } + + return auth; + } + private User ValidateUser(IRequest request, IAuthenticationAttributes authAttribtues) { // This code is executed before the service |
