aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2020-06-20 18:02:03 +0200
committerDavid <daullmer@gmail.com>2020-06-20 18:02:03 +0200
commit1c78482b480034738516596248955e3e09756dd6 (patch)
tree9f29040cabb37d86cbbece2f4f6b8c22d284432f /Emby.Server.Implementations/HttpServer/Security/AuthService.cs
parentbeb3896d7fba09e038b45c784273dbea1e48013c (diff)
Use authorization code from api-migration to fix startup wizard
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthService.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/Security/AuthService.cs16
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